/* themeToggle adjustments for light mode */
.themeToggle[data-theme="light"] {
  border-color: rgba(14, 165, 233, 0.8);
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.25), rgba(14, 165, 233, 0.08));
  box-shadow: 0 12px 16px rgba(14, 165, 233, 0.2), inset 0 0 0 1px rgba(14,165,233,.35);
}

.themeToggle[data-theme="light"]::after {
  transform: translateX(28px);
  background: #0ea5e9;
  box-shadow: 0 10px 20px rgba(14,165,233,.35);
}

/* Athletes modal + badges (light overrides) */
body.theme-light .detailsModalSurface{
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(15,23,42,0.14);
  box-shadow: 0 26px 70px rgba(15,23,42,0.12);
  color: #0f172a;
}
body.theme-light .sorenessCard{
  background:
    radial-gradient(120% 120% at 30% 10%, rgba(59,130,246,0.12), rgba(59,130,246,0.04) 45%, rgba(255,255,255,0.65) 100%),
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(241,245,249,0.92));
  border: 1px solid rgba(15,23,42,0.08);
}
body.theme-light .sorenessCard::before{
  background:
    radial-gradient(45% 45% at 50% 32%, rgba(249,115,22,0.20), transparent 70%),
    radial-gradient(45% 45% at 50% 68%, rgba(16,185,129,0.16), transparent 70%);
  filter: blur(26px);
  opacity: 0.8;
}
body.theme-light .sorenessOutline{
  stroke: rgba(15,23,42,0.25) !important;
}
body.theme-light .badge--primed{
  background: rgba(16,185,129,.12);
  border-color: rgba(16,185,129,.30);
  color: #065f46;
}
body.theme-light .badge--adaptive{
  background: rgba(245,158,11,.12);
  border-color: rgba(245,158,11,.32);
  color: #92400e;
}
body.theme-light .badge--overloaded{
  background: rgba(239,68,68,.12);
  border-color: rgba(239,68,68,.32);
  color: #991b1b;
}

/* Main Body and Background */
body.theme-light {
  background: linear-gradient(135deg, #f0f4f8 0%, #d9e2ec 100%);
  color: #1f2937; /* Darker gray for better legibility */
  --hair: rgba(148,163,184,0.28);
  --hair2: rgba(148,163,184,0.18);
  --glass: rgba(255,255,255,0.92);
  --glass2: rgba(255,255,255,0.78);
  --txt: #0f172a;
  --muted: #475569;
  --muted2: #64748b;
  --shadow: 0 16px 40px rgba(15,23,42,0.12);
  --radius: 18px;
}
/* Ensure dark ambient/bg is fully overridden in light mode */
html.theme-light,
html.theme-light body,
body.theme-light,
body.theme-light.bg-ambient {
  background: linear-gradient(135deg, #f0f4f8 0%, #d9e2ec 100%) !important;
  color: #1f2937;
}

/* Glassmorphism Card Style */
body.theme-light .cardGlass {
  background: #ffffff;
  background-image: none;
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  border: 1px solid rgba(148,163,184,.22);
  box-shadow: 0 14px 40px rgba(15,23,42,.12);
  color: #0f172a;
}
body.theme-light .cardGlass * { color: #0f172a; }

/* Fix visibility for internal containers (inner cards) */
body.theme-light .inner {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid rgba(148,163,184,.22);
}

/* Hard override of dark defaults that leak from dark.css */
body.theme-light .card,
body.theme-light .card-solid,
body.theme-light .card-inner{
  background: #ffffff !important;
  border: 1px solid rgba(148,163,184,0.22) !important;
  box-shadow: 0 18px 50px rgba(15,23,42,0.10) !important;
  color: #0f172a !important;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
body.theme-light .badge{
  background: #ffffff !important;
  border: 1px solid rgba(148,163,184,0.26) !important;
  color: #0f172a !important;
}
body.theme-light .field{
  background: #ffffff !important;
  border: 1px solid rgba(148,163,184,0.26) !important;
  color: #0f172a !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55) !important;
}
body.theme-light input,
body.theme-light select,
body.theme-light option{
  background: transparent !important;
  color: #0f172a !important;
}

body.theme-light .card,
body.theme-light .card-solid,
body.theme-light .card-inner{
  background: #ffffff !important;
  background-image: none !important;
  border-color: rgba(148,163,184,0.22) !important;
  box-shadow: 0 18px 50px rgba(15,23,42,0.10);
  color: #0f172a !important;
}

/* Sidebar Fixes */
body.theme-light .sideNav {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-color: rgba(203, 213, 225, 0.5);
}

/* Direct Text Visibility Fixes */
body.theme-light .text-white,
body.theme-light .text-white\/90,
body.theme-light .text-white\/80,
body.theme-light .text-white\/70,
body.theme-light .text-white\/60,
body.theme-light .text-white\/50,
body.theme-light .text-white\/40,
body.theme-light .text-white\/30,
body.theme-light .text-gray-400,
body.theme-light h2.text-white {
  color: #334155 !important; /* Force darker text for headers/labels */
}

/* Sub-labels should still be readable on glass */
body.theme-light .text-white\/40,
body.theme-light .text-white\/30,
body.theme-light .text-gray-400,
body.theme-light .text-gray-500{
  color: var(--lt-text-3) !important;
}

/* Engagement grid + score cells */
body.theme-light .cell{
  border: 1px solid #e2e8f0;
}
body.theme-light .inner .cell{
  border-color: #e2e8f0;
}

/* Engagement dots (light) */
body.theme-light .engagementCell{
  width: 12px;
  height: 12px;
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.65) inset;
}

/* Phase and Badge Tags */
body.theme-light .phase {
  border-color: #cbd5e1;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .01em;
  text-transform: none;
}

body.theme-light .badge {
  background: rgba(255, 255, 255, 0.8);
  border-color: #e2e8f0;
  color: #0f172a;
}

/* Buttons */
body.theme-light .collapseBtn,
body.theme-light .explainBtn {
  border-color: #cbd5e1;
  background: #ffffff;
  color: #1e293b;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Chart Canvas Adjustments */
body.theme-light canvas {
  filter: saturate(1.15) contrast(1.06);
}

/* Light theme tokens (used by our overrides below) */
body.theme-light{
  --lt-text: #0f172a;
  --lt-text-2: #334155;
  --lt-text-3: #334155; /* make "grey" actually readable */
  --lt-hair: rgba(15, 23, 42, 0.12);
  --lt-hair-2: rgba(15, 23, 42, 0.08);
  --lt-glass: rgba(255, 255, 255, 0.94);   /* brighter cards */
  --lt-glass-2: rgba(255, 255, 255, 0.88); /* inner glass */
  --lt-shadow: 0 16px 46px rgba(15, 23, 42, 0.08);
}

/* Force a clean light canvas */
body.theme-light,
html[data-theme="light"] body,
.theme-light body{
  background: #f8fafc !important;
  color: #0f172a !important;
}

/* Force readable defaults for any un-themed text */
body.theme-light,
body.theme-light *{
  color-scheme: light;
}

/* Catch the common Tailwind "dark" utility classes used in the HTML */
body.theme-light .bg-white\/5{ background: var(--lt-glass) !important; }
body.theme-light .bg-black\/40{ background: rgba(255,255,255,0.55) !important; }
body.theme-light .bg-black\/20{ background: rgba(255,255,255,0.45) !important; }
body.theme-light .bg-black\/15{ background: rgba(255,255,255,0.38) !important; }
body.theme-light .border-white\/10{ border-color: var(--lt-hair) !important; }
body.theme-light .border-hair{ border-color: var(--lt-hair) !important; }
body.theme-light .border-hair2{ border-color: var(--lt-hair-2) !important; }

/* Improve contrast for Tailwind gray utilities used as labels */
body.theme-light .text-gray-400{ color: var(--lt-text-3) !important; }
body.theme-light .text-gray-500{ color: var(--lt-text-3) !important; }
body.theme-light .text-gray-200{ color: var(--lt-text-2) !important; }
body.theme-light .text-gray-300{ color: var(--lt-text-2) !important; }

/* Ensure headings + key text are visible even when "text-white" classes exist */
body.theme-light h1,
body.theme-light h2,
body.theme-light h3,
body.theme-light .font-extrabold,
body.theme-light .font-bold,
body.theme-light .font-semibold{
  color: var(--lt-text) !important;
}

/* Glassmorphism: make cards feel more "glass" (stronger blur + softer highlight) */
body.theme-light .cardGlass,
body.theme-light .sideNav{
  background: #ffffff !important;
  background-image: none !important;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 18px 50px rgba(15,23,42,0.10);
  border-color: rgba(148,163,184,0.22) !important;
}

/* Nuke any dark overlay in light mode, regardless of selector specificity */
body.theme-light .cardGlass::before,
html[data-theme="light"] .cardGlass::before,
.theme-light .cardGlass::before,
.cardGlass.theme-light::before{
  content: none !important;
  display: none !important;
  background: transparent !important;
  opacity: 0 !important;
}

body.theme-light .inner{
  background: #ffffff !important;
  background-image: none !important;
  border-color: rgba(148,163,184,0.22) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.45);
}

/* Plot areas: avoid "washed out / invisible" charts on light */
body.theme-light .plotWrap{
  background: rgba(248,250,252,0.72) !important;
  border: 1px solid var(--lt-hair);
  border-radius: 14px;
  width:100%;
  max-width:100%;
}


/* Modal-specific adjustments */
body.theme-light #mblModal [data-mbl-modal-backdrop]{
  background: rgba(248,250,252,0.85);
  backdrop-filter: blur(18px);
}

body.theme-light #mblModal .rounded-3xl{
  background: rgba(255,255,255,0.95);
  border-color: rgba(15,23,42,0.18) !important;
  box-shadow: 0 30px 60px rgba(15,23,42,0.12);
  color: #0f172a;
}

body.theme-light #mblModal .rounded-2xl{
  background: rgba(241,245,249,0.9);
  border-color: rgba(148,163,184,0.4) !important;
  color: #0f172a;
}

body.theme-light #mblModal .badge{
  background: rgba(255,255,255,0.85);
  border-color: rgba(15,23,42,0.2);
  color: #0f172a;
}

body.theme-light #mblModal p,
body.theme-light #mblModal span,
body.theme-light #mblModal button{
  color: #0f172a;
}

body.theme-light #perfModal [data-perf-modal-backdrop]{
  background: rgba(248,250,252,0.85);
  backdrop-filter: blur(18px);
}

body.theme-light #perfModal .rounded-3xl{
  background: rgba(255,255,255,0.95);
  border-color: rgba(15,23,42,0.18) !important;
  box-shadow: 0 30px 60px rgba(15,23,42,0.12);
  color: #0f172a;
}

body.theme-light #perfModal .rounded-2xl{
  background: rgba(241,245,249,0.9);
  border-color: rgba(148,163,184,0.4) !important;
  color: #0f172a;
}

body.theme-light #perfModal .badge{
  background: rgba(255,255,255,0.85);
  border-color: rgba(15,23,42,0.2);
  color: #0f172a;
}

body.theme-light #perfModal p,
body.theme-light #perfModal span,
body.theme-light #perfModal button{
  color: #0f172a;
}

body.theme-light #clarityModal [data-clarity-modal-backdrop]{
  background: rgba(248,250,252,0.85);
  backdrop-filter: blur(18px);
}

body.theme-light #clarityModal .rounded-\[32px\],
body.theme-light #clarityModal .rounded-3xl,
body.theme-light #clarityModal .rounded-\[32px\]{
  background: rgba(255,255,255,0.95) !important;
  border-color: rgba(148,163,184,0.18) !important;
  box-shadow: 0 30px 60px rgba(15,23,42,0.12);
  color: #0f172a !important;
}
body.theme-light #clarityModal > .relative > div{
  background: rgba(255,255,255,0.95) !important;
  border-color: rgba(148,163,184,0.18) !important;
  box-shadow: 0 30px 60px rgba(15,23,42,0.12);
  color: #0f172a !important;
}
body.theme-light #clarityModal > .relative > div *{
  color: #0f172a !important;
}

body.theme-light #clarityModal .plotWrap{
  background: rgba(248,250,252,0.95) !important;
  border-color: rgba(148,163,184,0.18) !important;
  border-radius: 18px;
  box-shadow: inset 0 2px 6px rgba(15,23,42,0.04);
}

body.theme-light #clarityModal .badge{
  background: rgba(255,255,255,0.85) !important;
  border-color: rgba(15,23,42,0.2) !important;
  color: #0f172a !important;
}

body.theme-light #clarityModal p,
body.theme-light #clarityModal span,
body.theme-light #clarityModal button{
  color: #0f172a !important;
}

body.theme-light #clarityModal .plotWrap canvas{
  filter: saturate(1.1) contrast(1.05);
}

body.theme-light #rpeModal [data-rpe-modal-backdrop]{
  background: rgba(248,250,252,0.85);
  backdrop-filter: blur(18px);
}

body.theme-light #rpeModal .rounded-[32px],
body.theme-light #rpeModal .rounded-3xl,
body.theme-light #rpeModal .rounded-\[32px\]{
  background: rgba(255,255,255,0.95) !important;
  border-color: rgba(15,23,42,0.18) !important;
  box-shadow: 0 30px 60px rgba(15,23,42,0.12);
  color: #0f172a !important;
}

body.theme-light #rpeModal .bg-\[\#030711\]\/95{
  background-color: rgba(255,255,255,0.95) !important;
}

body.theme-light #rpeModal .bg-\\#030711\\/95{
  background-color: rgba(255,255,255,0.95) !important;
}

body.theme-light #rpeModal .plotWrap{
  background: rgba(248,250,252,0.95) !important;
  border-color: rgba(148,163,184,0.18) !important;
  border-radius: 18px;
  box-shadow: inset 0 2px 6px rgba(15,23,42,0.04);
}
body.theme-light .plotWrap{
  overflow: hidden;
  background: #f8fafc !important;
  border-color: rgba(148,163,184,0.26) !important;
}

/* Force ambient background to plain light when theme is light */
body.theme-light.bg-ambient,
html[data-theme="light"] .bg-ambient,
.theme-light .bg-ambient,
.bg-ambient.theme-light{
  background: #f8fafc !important;
  background-image: none !important;
  color: #0f172a !important;
}

/* Force any ambient/dark backgrounds to light */
body.theme-light .bg-ambient{
  background: #f8fafc !important;
}
body.theme-light .bg-premium,
body.theme-light .bg-panel\/70,
body.theme-light .bg-card2\/60,
body.theme-light .bg-card2\/85{
  background: #f8fafc !important;
  background-image: none !important;
}
body.theme-light .plotWrap canvas{
  width: 100% !important;
  height: 100% !important;
  display: block;
}

body.theme-light #rpeModal .rounded-2xl{
  background: rgba(241,245,249,0.9);
  border-color: rgba(148,163,184,0.4) !important;
  color: #0f172a !important;
}

body.theme-light #rpeModal .badge{
  background: rgba(255,255,255,0.85) !important;
  border-color: rgba(15,23,42,0.2) !important;
  color: #0f172a !important;
}

body.theme-light #rpeModal p,
body.theme-light #rpeModal span,
body.theme-light #rpeModal button{
  color: #0f172a !important;
}

body.theme-light #rpeModal .plotWrap canvas{
  filter: saturate(1.1) contrast(1.05);
}

body.theme-light #clarityModal .rounded-2xl{
  background: rgba(241,245,249,0.9);
  border-color: rgba(148,163,184,0.4) !important;
  color: #0f172a !important;
}

body.theme-light #dateFilterModal [data-date-filter-backdrop]{
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(18px);
}

body.theme-light #dateFilterModal .rounded-\[32px\]{
  background: rgba(255,255,255,0.92);
  border-color: rgba(15,23,42,0.12) !important;
  box-shadow: 0 30px 60px rgba(15,23,42,0.15);
  color: #0f172a;
}

body.theme-light #dateFilterModal .badge{
  background: rgba(248,250,252,0.8);
  border-color: rgba(15,23,42,0.16);
  color: #0f172a;
}

body.theme-light #dateFilterModal button{
  color: #0f172a;
}

body.theme-light #dateFilterModal .plotWrap{
  background: rgba(15,23,42,0.05) !important;
  border-color: rgba(15,23,42,0.12) !important;
}

body.theme-light #dateFilterModal .plotWrap canvas{
  filter: saturate(1.05) contrast(1.02);
}

body.theme-light #emotionModal [data-emotion-modal-backdrop],
body.theme-light #wordCloudModal [data-wordcloud-modal-backdrop]{
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(20px);
}

body.theme-light #emotionModal .rounded-\[32px\],
body.theme-light #wordCloudModal .rounded-\[32px\]{
  background: rgba(255,255,255,0.94);
  border-color: rgba(15,23,42,0.12) !important;
  box-shadow: 0 30px 60px rgba(15,23,42,0.15);
  color: #0f172a;
}

body.theme-light #emotionModal .plotWrap,
body.theme-light #wordCloudModal .plotWrap{
  background: rgba(15,23,42,0.05) !important;
  border-color: rgba(15,23,42,0.12) !important;
}

body.theme-light #emotionModal .badge,
body.theme-light #wordCloudModal .badge{
  background: rgba(248,250,252,0.85);
  border-color: rgba(15,23,42,0.12);
  color: #0f172a;
}

body.theme-light #emotionModal button,
body.theme-light #wordCloudModal button{
  color: #0f172a;
}

body.theme-light #emotionModal .plotWrap canvas,
body.theme-light #wordCloudModal .plotWrap canvas{
  filter: saturate(1.1) contrast(1.05);
}

body.theme-light .notification-panel{
  background: rgba(255,255,255,0.94);
  border-color: rgba(15,23,42,0.12);
  box-shadow: 0 25px 55px rgba(15,23,42,.12);
  backdrop-filter: blur(28px);
  z-index: 99999; 
}
body.theme-light .notification-item{
  border-color: rgba(15,23,42,0.1) !important;
  background: rgba(15,23,42,0.04) !important;
  box-shadow: 0 10px 36px rgba(15,23,42,.08);
}
body.theme-light .notification-panel .text-white{
  color: #0f172a !important;
}
body.theme-light .notification-panel .text-white\/50{
  color: rgba(15,23,42,0.55) !important;
}
body.theme-light .notification-panel .text-white\/60,
body.theme-light .notification-panel .text-white\/70,
body.theme-light .notification-panel .text-white\/80{
  color: rgba(15,23,42,0.72) !important;
}

body.theme-light #sorenessModal [data-soreness-modal-backdrop]{
  background: rgba(248,250,252,0.85);
  backdrop-filter: blur(18px);
}

body.theme-light #sorenessModal .rounded-3xl{
  background: rgba(255,255,255,0.95);
  border-color: rgba(15,23,42,0.18) !important;
  box-shadow: 0 30px 60px rgba(15,23,42,0.12);
  color: #0f172a;
}

body.theme-light #sorenessModal .rounded-2xl{
  background: rgba(241,245,249,0.9);
  border-color: rgba(148,163,184,0.4) !important;
  color: #0f172a;
}

body.theme-light #sorenessModal .badge{
  background: rgba(255,255,255,0.85);
  border-color: rgba(15,23,42,0.2);
  color: #0f172a;
}

body.theme-light #sorenessModal p,
body.theme-light #sorenessModal span,
body.theme-light #sorenessModal button{
  color: #0f172a;
}

/* ? explain buttons: force the SVG strokes to be visible in light mode */
body.theme-light .explainBtn svg path,
body.theme-light .explainBtn svg circle,
body.theme-light .explainBtn svg rect{
  stroke: rgba(15, 23, 42, 0.85) !important;
}

/* Body soreness map: make "neutral" greys visible (head circle, borders) */
body.theme-light .plotWrap svg circle{
  fill: rgba(51, 65, 85, 0.16) !important;
  stroke: rgba(51, 65, 85, 0.25) !important;
}
body.theme-light .plotWrap svg text{
  fill: rgba(15, 23, 42, 0.82) !important;
}

/* Inputs / search: text + placeholder + focus ring */
body.theme-light input,
body.theme-light select,
body.theme-light textarea{
  color: var(--lt-text) !important;
}
body.theme-light select option{
  color: var(--lt-text) !important;
  background: #ffffff !important;
}
body.theme-light input::placeholder,
body.theme-light textarea::placeholder{
  color: rgba(51, 65, 85, 0.55) !important;
}
body.theme-light input[type="date"]::-webkit-calendar-picker-indicator{
  filter: invert(23%) sepia(20%) saturate(680%) hue-rotate(176deg) brightness(90%) contrast(92%);
}
body.theme-light input:disabled,
body.theme-light select:disabled,
body.theme-light textarea:disabled{
  color: rgba(100, 116, 139, 0.8) !important;
}
body.theme-light .focus-within\:border-cyan:focus-within{
  border-color: rgba(6,182,212,0.65) !important;
}

/* Sidebar links: keep the selected item clearly visible */
body.theme-light .sideNav a{
  color: var(--lt-text-2) !important;
}
body.theme-light .sideNav a:hover{
  color: var(--lt-text) !important;
}

/* "Open Search / Close Explain" chips in sidebar */
body.theme-light .sideNav .text-white\/60{ color: rgba(51,65,85,0.65) !important; }

/* Explain panel: make it light (your screenshot request) */
body.theme-light .panelBack{
  background: rgba(2, 6, 23, 0.18);
}
body.theme-light .explainPanel{
  background: rgba(255,255,255,0.72) !important;
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-left: 1px solid var(--lt-hair);
  box-shadow: -12px 0 40px rgba(2, 6, 23, 0.10);
  color: var(--lt-text) !important;
}
body.theme-light .explainPanelHeader{
  background: rgba(255,255,255,0.55) !important;
  border-bottom: 1px solid var(--lt-hair);
}
body.theme-light .explainPanelBody{
  color: var(--lt-text-2) !important;
}
body.theme-light #panelTitle{
  color: var(--lt-text) !important;
}

/* Buttons: improve hover and keep icons readable */
body.theme-light .collapseBtn:hover,
body.theme-light .explainBtn:hover{
  background: rgba(255,255,255,0.78) !important;
}
body.theme-light button svg{
  color: rgba(51,65,85,0.75) !important;
}

/* ? help buttons: force the inline SVG strokes to be visible in light mode */
body.theme-light .explainBtn svg path,
body.theme-light .explainBtn svg circle,
body.theme-light .explainBtn svg rect{
  stroke: rgba(15, 23, 42, 0.85) !important;
}
body.theme-light .explainBtn{
  background: rgba(255,255,255,0.85) !important;
  border-color: rgba(15,23,42,0.16) !important;
}

/* Body soreness map: the "grey" silhouette was disappearing */
body.theme-light .plotWrap svg circle{
  fill: rgba(51, 65, 85, 0.16) !important;
  stroke: rgba(51, 65, 85, 0.22) !important;
}
body.theme-light .plotWrap svg rect{
  stroke: rgba(51, 65, 85, 0.18) !important;
}
body.theme-light .plotWrap svg text{
  fill: rgba(15, 23, 42, 0.85) !important;
}

/* New silhouette map: keep numbers visible on the dark vignette background */
body.theme-light [data-body-soreness-map]{
  --soreness-bg: radial-gradient(120% 120% at 50% 30%, rgba(255,255,255,0.96), rgba(241,245,249,0.9) 70%, rgba(226,232,240,0.86) 100%);
  --soreness-border: rgba(148,163,184,0.55);
  --soreness-shadow: 0 12px 32px rgba(148,163,184,0.28);
  --soreness-text: rgba(15,23,42,0.85);
  --soreness-outline: rgba(15,23,42,0.3);
}
body.theme-light [data-body-soreness-map] svg text{
  fill: var(--soreness-text) !important;
}
body.theme-light [data-body-soreness-map] svg use{
  stroke: var(--soreness-outline) !important;
}
body.theme-light [data-body-soreness-map] .soreness-label{
  color: #0f172a;
}

/* Modal panels (light mode) */
body.theme-light .modal-panel{
  background: rgba(255,255,255,0.96) !important;
  border-color: rgba(15,23,42,0.12) !important;
  color: #0f172a !important;
  box-shadow: 0 24px 60px rgba(15,23,42,0.12);
}
body.theme-light .modal-panel p,
body.theme-light .modal-panel span,
body.theme-light .modal-panel h3{
  color: #0f172a !important;
}

/* Athletes loader: keep readable in light mode */
body.theme-light .rosterLoaderOverlay{
  background: linear-gradient(180deg, rgba(248,250,252,0.96), rgba(226,232,240,0.92)) !important;
  color: #0f172a !important;
}
body.theme-light .rosterLoaderOverlay p{
  color: #0f172a !important;
}
body.theme-light .rosterLoaderOverlay .animate-spin{
  border-color: rgba(15,23,42,0.18) !important;
  border-top-color: rgba(37,99,235,0.85) !important;
}

/* Dashboard loader (overview) */
body.theme-light .dashboardLoaderOverlay{
  background: linear-gradient(180deg, rgba(248,250,252,0.96), rgba(226,232,240,0.92)) !important;
  color: #0f172a !important;
}
body.theme-light .dashboardLoaderOverlay p{
  color: #0f172a !important;
}
body.theme-light .dashboardLoaderOverlay .animate-spin{
  border-color: rgba(15,23,42,0.18) !important;
  border-top-color: rgba(37,99,235,0.85) !important;
}
body.theme-light .modal-panel .bg-white\/5{
  background: rgba(15,23,42,0.05) !important;
  border-color: rgba(15,23,42,0.12) !important;
}

body.theme-light [data-fatigue-modal-backdrop],
body.theme-light [data-hydration-modal-backdrop],
body.theme-light [data-hrv-modal-backdrop],
body.theme-light [data-rhr-modal-backdrop]{
  background: rgba(241,245,249,0.82);
  backdrop-filter: blur(16px);
}

body.theme-light #rpeModal .plotWrap{
  background: rgba(241,245,249,0.85) !important;
  border-color: rgba(148,163,184,0.35) !important;
}

/* Heatmap cells: visible borders on light */
body.theme-light .cell{
  border: 1px solid rgba(15,23,42,0.08);
}

/* Footer kbd chip (if styled in dark.css) */
body.theme-light .kbd{
  background: rgba(255,255,255,0.75);
  border: 1px solid rgba(15,23,42,0.12);
  color: var(--lt-text);
}

body.theme-light .custom-calendar{
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(248,250,252,0.95));
  border-color: rgba(15,23,42,0.15);
  box-shadow: 0 20px 40px rgba(15,23,42,0.15);
}
.custom-calendar{
  position: fixed;
  top: 0;
  left: 0;
  width: min(320px, 100%);
  padding: 1.25rem;
  border-radius: 28px;
  border: 1px solid rgba(148,163,184,0.24);
  background: #ffffff;
  box-shadow: 0 25px 55px rgba(15,23,42,0.12);
  z-index: 100000;
}
.custom-calendar{
  display: none !important;
}
.custom-calendar.open{
  display: grid !important;
}
.custom-calendar.hidden{
  display: none !important;
}
body.theme-light .custom-calendar__header,
body.theme-light .custom-calendar__weekdays{
  color: #0f172a;
}
body.theme-light .custom-calendar__weekdays{
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .01em;
  text-transform: none;
}
body.theme-light .custom-calendar__nav-btn{
  border-color: rgba(15,23,42,0.15);
  background: rgba(15,23,42,0.05);
  color: #0f172a;
}
body.theme-light .custom-calendar__nav-btn:hover{
  background: rgba(14,165,233,.16);
}
body.theme-light .custom-calendar__day{
  background: rgba(2,6,23,0.06);
  color: var(--lt-text-2);
}
body.theme-light .custom-calendar__day:hover{
  background: rgba(14,165,233,.18);
}
body.theme-light .custom-calendar__day--today{
  border-color: rgba(16,185,129,.45);
}
body.theme-light .custom-calendar__day--selected{
  background: linear-gradient(180deg, rgba(14,165,233,.85), rgba(59,130,246,.85));
  color: #fff;
  box-shadow: 0 10px 18px rgba(13,110,253,.25);
}
body.theme-light .custom-calendar__note{
  color: rgba(15,23,42,0.65);
}

/* Tables: improve contrast and row separation */
body.theme-light table{
  color: var(--lt-text) !important;
}
body.theme-light thead tr{
  background: rgba(15,23,42,0.04);
}
body.theme-light thead th{
  color: rgba(51,65,85,0.85) !important;
}
body.theme-light tbody tr{
  border-color: rgba(148,163,184,0.25) !important;
}
body.theme-light tbody tr:hover{
  background: rgba(59,130,246,0.06) !important;
}

/* Badges + pills */
body.theme-light .badge{
  background: rgba(248,250,252,0.95) !important;
  border-color: rgba(148,163,184,0.35) !important;
  color: #0f172a !important;
}

/* Chart grids: keep labels crisp in light mode */
body.theme-light .plotWrap{
  background: rgba(248,250,252,0.92) !important;
  border-color: rgba(148,163,184,0.3) !important;
}
body.theme-light .plotWrap canvas{
  filter: saturate(1.08) contrast(1.04);
}

/* Engagement calendar readability */
body.theme-light .engagementCell span{
  color: #0f172a !important;
}

/* Keep soreness map content contained */
[data-soreness-modal-trigger].plotWrap{
  overflow:hidden !important;
  height:240px;
  max-height:240px;
}

/* Keep heatmap grid contained */
#heatmapGrid{
  overflow:hidden;
  width:100%;
  max-width:100%;
  box-sizing:border-box;
  display:grid;
  max-height:160px;
  padding-right:2px;
}

/* Clip any chart/grid content to its card */
.plotWrap{
  overflow:hidden;
  width:100%;
  max-width:100%;
}
