/* SanoobFit light theme (founder only for now, 12 Nov 2026; docs/LIGHT_THEME_PLAN.md).
   EVERY rule in this file starts with html[data-theme="light"], so it can never change dark. Light is set only on the
   founder's account (member_feature_switches) when he chooses Light in Settings, Appearance.
   His rules: everything clearly visible, no faded look; text at least 4.5 to 1 against what is behind it; borders,
   icons and lines at least 3 to 1; every card, button and box with a proper visible border; lime text a darker green.
   Loaded after each page's own styles and after sf-glass.css, so these light values win only in light. */

/* ---- 1. The shared colours, one set for every screen (a superset of each page's own names) ---- */
html[data-theme="light"]{
  --bg:#e9ece6; --bg-2:#e1e5dd; --surface:#ffffff; --surface-2:#f3f5f0; --surface2:#f3f5f0;
  --text:#14181c; --muted:#4a5058;
  --accent:#345c06; --accent-ink:#ffffff; --accent-ink-soft:#dbeac0;
  --danger:#b3261e; --gold:#8a6110; --blue:#155f94;
  --p:#345c06; --c:#155f94; --f:#8f530c;
  --border:#70767e; --border-strong:#5a6068;
  /* the other names some screens use (Coach chat, Profile, Health, Trends, Report, Coach Intelligence) */
  --bg2:#e1e5dd; --panel:#ffffff; --panel2:#f3f5f0; --line:#70767e; --line2:#5a6068;
  --lime:#345c06; --lime-ink:#ffffff; --faint:#4a5058; --info:#155f94; --ok:#1d6b40; --warn:#8f4a06;
  --am-open:#1d6b40; --am-approval:#155f94; --am-invite:#5b3a9e; --am-assigned:#0f6660; --am-closed:#b3261e;
  color-scheme:light;

  /* liquid glass, light: white glass, a solid grey rim that reaches 3 to 1, soft shadows */
  --g-bg:#e9ece6;
  --g-streaks: radial-gradient(90% 55% at 15% 0%, rgba(140,190,40,.10), transparent 60%),
               radial-gradient(80% 50% at 100% 45%, rgba(60,140,200,.08), transparent 62%);
  --g-fill: linear-gradient(#ffffff, #ffffff);
  --g-rim: linear-gradient(#70767e, #70767e);
  --g-rim-green: linear-gradient(#345c06, #345c06);
  --g-rim-gold: linear-gradient(#8a6110, #8a6110);
  --g-rim-blue: linear-gradient(#155f94, #155f94);
  --g-inner: none;
  --g-shadow: 0 6px 16px -10px rgba(20,30,10,.30);
  --g-pill: linear-gradient(#ffffff, #ffffff);
  --g-bevel: 0 3px 8px -6px rgba(0,0,0,.30);
  --g-bar: #ffffff;
  --g-sheet: #ffffff;
}
html[data-theme="light"] body{ background-color:var(--bg); color:var(--text); }

/* ---- 2. The status bar stays readable: the phone's own status bar writing is white (the apps are dark until the next
   native release), so a dark strip stays behind it ---- */
html[data-theme="light"] body::after{
  content:""; position:fixed; left:0; right:0; top:0; height:env(safe-area-inset-top,0px);
  background:#0a0b0d; z-index:2147483000; pointer-events:none;
}

/* ---- 3. Home (app.html), measured fixes ---- */
html[data-theme="light"] .tt-ribbon, html[data-theme="light"] .tt-ribbon b, html[data-theme="light"] .tt-rb-arrow{ color:var(--text) !important; }
html[data-theme="light"] .ag-track{ border:1px solid var(--border-strong) !important; }
html[data-theme="light"] .agt-bar{ border:1px solid var(--border) !important; }
html[data-theme="light"] .agt-ring{ color:var(--text) !important; }
html[data-theme="light"] .agt-ring-bg{ stroke:var(--border) !important; fill:#f3f5f0 !important; }
html[data-theme="light"] .cv-ic, html[data-theme="light"] .ps-ic, html[data-theme="light"] .ps-go{ color:var(--accent) !important; }
html[data-theme="light"] .hbar-upgrade{ border:1px solid var(--gold) !important; }
html[data-theme="light"] .tabbar .tab.on{ color:var(--accent) !important; }
html[data-theme="light"] .tabbar .tab.on[data-tab="train"]{ color:var(--blue) !important; }
html[data-theme="light"] .tabbar .tab.on[data-tab="chat"]{ color:#5b3a9e !important; }
html[data-theme="light"] .lock-ov{ background:rgba(233,236,230,.97) !important; }
html[data-theme="light"] .lock-ov .lk-up{ border:1px solid #233d04 !important; }

/* ---- 4. Community, measured fixes ---- */
/* the challenge card's rank sits on the cover photo: a solid light pill keeps it readable whatever the photo */
html[data-theme="light"] .hcard-rank{ background:#ffffff !important; color:var(--gold) !important; border:1px solid var(--gold) !important; }

/* ---- 5. Login (website), measured fixes ---- */
html[data-theme="light"] #tabSignin.active, html[data-theme="light"] #tabSignup.active{ box-shadow:inset 0 0 0 1px var(--border) !important; }

/* ---- 6. Edges and component roles, measured with the safety net switched off (13 Nov 2026;
   docs/LIGHT_THEME_SYSTEM_PLAN.md section 9). Each is a box whose own fill matches what is around it in light, or a
   part whose colour comes from a mix the table cannot see. An outline is used for the edge, so nothing moves by a
   pixel and an existing border or shadow is kept. ---- */
html[data-theme="light"] .rc-status.empty,
html[data-theme="light"] .swact .swbtn.more,
html[data-theme="light"] .sk-home-wrap .sk,
html[data-theme="light"] .sk-home-cards .sk,
html[data-theme="light"] .skel .skel-thumb,
html[data-theme="light"] .rc-status.low,
html[data-theme="light"] .rc-status.ok,
html[data-theme="light"] .rc-status.good,
html[data-theme="light"] .unit-toggle button.on,
html[data-theme="light"] .tt-hero .tt-cell,
html[data-theme="light"] .exlib-row .er-ph,
html[data-theme="light"] .hub-tile,
html[data-theme="light"] .sf-toast,
html[data-theme="light"] .card.tcard,
html[data-theme="light"] .up-card-core .up-cicon,
html[data-theme="light"] .up-card-premium .up-cicon,
html[data-theme="light"] .ag-mcell,
html[data-theme="light"] .tile .ic,
html[data-theme="light"] .lb-pcard,
html[data-theme="light"] .lb-plinth{ outline:1px solid var(--border) !important; outline-offset:-1px; }
/* the podium's medal ring at full strength (its colour is the medal's, set per place) */
html[data-theme="light"] .lb-pav{ border-color:color-mix(in srgb, rgb(var(--rc)) 55%, #000) !important; }
html[data-theme="light"] .lb-pscore{ color:#2c4f05 !important; }
/* a milestone's "Locked" badge: a pale badge with an edge, not a grey fill */
html[data-theme="light"] .ms-ov-state.locked{ background:var(--surface-2) !important; color:var(--muted) !important; outline:1px solid var(--border); outline-offset:-1px; }
/* picker wheels: the script sets the numbers beside the chosen one faint; in light every number reads (no faded look) */
html[data-theme="light"] .wheel-item, html[data-theme="light"] .vw-item{ opacity:1 !important; }

/* ---- 7. Writing over a photo (14 Nov 2026, found on the real screens). Home's Training and Nutrition covers and
   Community's challenge cards fade a photo in behind the right part of their writing; in dark that is white on a dark
   photo, in light it was dark writing on a dark photo. A soft glow in the card's own colour keeps every word readable on
   any photo. Only writing that sits straight on the card (never a badge or button with its own fill). Nothing
   moves; light only. ---- */
html[data-theme="light"] .cover .cv-t, html[data-theme="light"] .cover .cv-s,
html[data-theme="light"] .hcard-rich .hcard-name, html[data-theme="light"] .hcard-rich .hcard-sub,
html[data-theme="light"] .hcard-rich .pbar-pct, html[data-theme="light"] .hcard-rich .avstack-count,
html[data-theme="light"] .dcard-name, html[data-theme="light"] .dcard-desc, html[data-theme="light"] .dcard-meta{
  text-shadow:0 0 2px var(--surface), 0 0 6px var(--surface), 0 0 12px var(--surface), 0 0 18px var(--surface); }
/* Coach inbox: the deep blue Unread button behind a swiped conversation keeps white writing and a white icon in light
   (14 Nov 2026, found by the watcher on the Redmi) */
html[data-theme="light"] .swact .swbtn.unread{ color:#ffffff !important; }
