/*
 * LBRank — UNIVERSAL MONOCHROME THEME
 * Single source of truth for app-wide COLOR (not layout).
 * Every page, subpage, modal, and component inherits these tokens.
 * Keep photographs, card artwork, video, holo effects, data graphics and
 * status semantics intact; this file changes interface chrome only.
 *
 * Color map:
 *  Background / canvas       #000000
 *  Surface / cards / modal    #000000
 *  Header / title            #FFFFFF
 *  Subheader / subtitle      #FFFFFF
 *  Body / secondary text     #FFFFFF
 *  Button / selected button  #FFFFFF
 *  Icon / SVG                #FFFFFF
 *  Borders / separators      rgba(255,255,255,.25)
 *  Graph / accent            #FFFFFF
 *  Disabled                  rgba(255,255,255,.45)
 */
:root,html,html[data-lbrank-ui],body{
  color-scheme:dark!important;
  --theme-primary:#fff!important;--theme-secondary:#fff!important;
  --theme-primary-rgb:255,255,255!important;--theme-secondary-rgb:255,255,255!important;
  --theme-glow:#fff!important;--theme-glow-rgb:255,255,255!important;
  --theme-background:#000!important;--theme-background-rgb:0,0,0!important;
  --theme-background-deep:#000!important;--theme-text:#fff!important;
  --theme-text-muted:#fff!important;--theme-special-text:#fff!important;
  --theme-header:#fff!important;--theme-subheader:#fff!important;
  --ui-header:#fff!important;--ui-header-color:#fff!important;
  --ui-subheader:#fff!important;--ui-subheader-color:#fff!important;
  --ui-special-text:#fff!important;--ui-card-title:#fff!important;
  --ui-card-title-color:#fff!important;--ui-card-description:#fff!important;
  --ui-card-description-color:#fff!important;
  --ui-graph-loss-color:#fff!important;--ui-graph-gain-color:#fff!important;
  --ui-graph-neutral-color:#fff!important;
  --accent:#fff!important;--accent-rgb:255,255,255!important;
  --primary:#fff!important;--secondary:#fff!important;
  --text-primary:#fff!important;--text-secondary:#fff!important;
  --text-muted:#fff!important;--muted:#fff!important;
  --surface:#000!important;--surface-2:#000!important;--panel:#000!important;
  --background:#000!important;--bg:#000!important;
  --border-color:rgba(255,255,255,.25)!important;
  --progress-nav-primary:#fff!important;
}
html body,html body .app-wrapper,html body .app-container,
html body .tab-content,html body .page-container,
html body :is(.modal,.modal-content,.dialog,.dialog-content,[role="dialog"],
 .settings-panel,.settings-card,.theme-dropdown-content,.general-theme-section,
 .workout-exercise-card,.workout-body-part-group,.progress-mode-view,
 .cal-tracker-card,.cal-progress-chart,.info-topic-card,.learning-card,
 .hadith-modal,.hadith-reading-card,.hadith-collection-card,
 .history-list,.workout-history-record,.workout-history-calendar,
 .tab-nav,.bottom-nav,.nav-bar,.card,.panel,.widget,.sheet,.popover,
 .dropdown-menu,.lbc-gallery-viewer,.lbc-collections-shell){
  background-color:#000!important;
  color:#fff!important;
}
/* Override legacy per-page variables, including page-specific themes. */
html body :is(#rank-tab,#graph-tab,#calories-tab,#workout-tab,
 #cards-tab,#french-tab,#info-tab,#settings-tab,#badges-tab,
 .tab-content,.progress-mode-view,.workout-exercise-card,.hadith-modal,
 .lbc-collections-shell,.cal-progress-chart){
  --page-accent:#fff!important;--page-tint:255,255,255!important;
  --mode-accent:#fff!important;--mode-rgb:255,255,255!important;
  --muscle-color:#fff!important;--muscle-rgb:255,255,255!important;
  --series-color:#fff!important;--accent:#fff!important;
  --theme-primary:#fff!important;--theme-primary-rgb:255,255,255!important;
  --theme-secondary:#fff!important;--theme-glow:#fff!important;
  --ui-header:#fff!important;--ui-header-color:#fff!important;
  --ui-special-text:#fff!important;--theme-special-text:#fff!important;
  --theme-background:#000!important;--theme-background-rgb:0,0,0!important;
  --theme-text:#fff!important;--theme-text-muted:#fff!important;
}
/* Typography: headers, subheaders, body, captions, numbers, links. */
html body :is(h1,h2,h3,h4,h5,h6,p,small,label,legend,summary,
 blockquote,figcaption,dt,dd,th,td,output,caption,
 .section-title,.section-heading,.app-page-header,.app-page-kicker,
 .section-kicker,.card-title,.card-description,.tab-label,
 .badge-title,.milestone-heading,.workout-exercise-heading,
 .workout-body-part-head,.workout-series-group h4,
 .workout-history-exercise,.calorie-stat-number,.cal-history-loss,
 .hadith-reference,.hadith-topbar,.hadith-book-title,
 .info-topic-copy,.rank-life-dashboard-value,
 .history-total-change,.progress-choice-option){
  color:#fff!important;-webkit-text-fill-color:#fff!important;
}
/* Keep normal/selected button styles monochrome without inventing boxes. */
html body :is(button,[role="button"],.btn,.tab-btn,.range-btn,
 .progress-mode-card,.progress-choice-option,.workout-flow-toggle,
 .workout-series-toggle,.workout-weight-option,.filter-chip,
 .segmented-control,.theme-preset-filter-btn){
  color:#fff!important;-webkit-text-fill-color:#fff!important;
  --accent:#fff!important;--theme-primary:#fff!important;
}
html body :is(button,[role="button"],.btn,.tab-btn,.range-btn,
 .progress-mode-card,.progress-choice-option,.workout-flow-toggle,
 .workout-series-toggle,.workout-weight-option,.filter-chip):is(
 .active,.selected,.is-active,.is-selected,[aria-pressed="true"],[aria-selected="true"]){
  color:#fff!important;-webkit-text-fill-color:#fff!important;
  border-color:#fff!important;
}
html body :is(button,[role="button"],.tab-btn,.progress-mode-card,
 .progress-choice-option,.workout-series-toggle) :is(span,strong,small){
  color:inherit!important;-webkit-text-fill-color:currentColor!important;
}
/* Icons: UI icons only, not card art, album art, or images. */
html body :is(button,a,.tab-nav,.app-page-header,.settings-panel,
 .workout-exercise-card,.progress-mode-view,.hadith-modal)
 :is(svg:not(.lbrank-holo-frame svg),.tab-icon,.lucide,[class*="icon-"]){
  color:#fff!important;stroke:currentColor;
}
html body :is(button,a,.tab-nav,.settings-panel,.progress-mode-view) svg :is(path,line,polyline,circle,rect){
  stroke:inherit;
}
/* Forms and controls. */
html body :is(input:not([type="color"]),textarea,select,option){
  color:#fff!important;-webkit-text-fill-color:#fff!important;
  caret-color:#fff!important;accent-color:#fff!important;
}
html body :is(input,textarea,select)::placeholder{color:rgba(255,255,255,.65)!important;-webkit-text-fill-color:rgba(255,255,255,.65)!important}
html body :is(input[type="checkbox"],input[type="radio"],input[type="range"],progress){accent-color:#fff!important}
html body :is(button,input,textarea,select,a,summary):focus-visible{outline-color:#fff!important}
/* Links, selected navigation, tabs and underlines. */
html body a:not(:has(img)){color:#fff!important;-webkit-text-fill-color:#fff!important}
html body :is(.tab-btn,.progress-mode-card,.progress-choice-option,.range-btn,
 .workout-flow-toggle,.workout-series-toggle).active,
html body :is(.tab-btn,.progress-mode-card,.progress-choice-option,.range-btn,
 .workout-flow-toggle,.workout-series-toggle).is-selected{
  color:#fff!important;-webkit-text-fill-color:#fff!important;
}
html body :is(.tab-nav,.progress-mode-view,.workout-reps-history,
 .hadith-modal,.settings-panel) :is(hr,.divider){border-color:rgba(255,255,255,.25)!important}
/* Disable decorative colored tints, without affecting artwork itself. */
html body :is(.workout-exercise-card,.progress-mode-card,.progress-choice-option,
 .workout-flow-toggle,.workout-series-toggle,.settings-card,.info-topic-card,
 .hadith-reading-card,.hadith-collection-card,.cal-progress-chart){
  background-image:none!important;
  box-shadow:none!important;
}
/* SVG chart lines that use CSS currentColor inherit white; canvas charts
   are drawn by JS and require separate canvas color handling. */
html body :is(.progress-mode-view,.cal-line-graph,.workout-progress-chart)
 svg:not(.tab-icon svg){color:#fff!important}
html body :is(.progress-mode-view,.cal-line-graph) svg
 :is(path[stroke],line[stroke],polyline[stroke]){
  stroke:#fff!important
}
/* Preserve contrast for disabled controls without changing the palette. */
html body :is(button,input,select,textarea):disabled{opacity:.45}

/* MONOCHROME CONTRAST CONTRACT
   White-filled interactive elements always have black labels and icons.
   Transparent/black controls retain white labels. No page may reintroduce
   colored selected states, including the three Progress mode tabs. */
html body :is(button,[role="button"],input[type="button"],input[type="submit"],
 .btn,.tab-btn,.progress-mode-card,.progress-choice-option,.range-btn,
 .workout-flow-toggle,.workout-weight-option,.filter-chip,.eta-entry-btn,
 .settings-action,.ui-design-option,.general-theme-reset):is(
 .active,.is-active,.selected,.is-selected,[aria-selected="true"],[aria-pressed="true"]){
  --accent:#fff!important;--theme-primary:#fff!important;
  border-color:#fff!important;
}
/* Known solid/filled controls, including inline white backgrounds. */
html body :is(button,[role="button"],input[type="button"],input[type="submit"],
 .btn,.light-button,.white-button,.btn-light,.button-light,
 .settings-action,.ui-design-option,.general-theme-reset):is(
 .light-button,.white-button,.btn-light,.button-light,
 [style*="background: white"],[style*="background:white"],
 [style*="background:#fff"],[style*="background: #fff"],
 [style*="background:#FFF"],[style*="background: #FFF"],
 [style*="background: rgb(255"],[style*="background:rgb(255"],
 [style*="background-color: white"],[style*="background-color:white"],
 [style*="background-color:#fff"],[style*="background-color: #fff"],
 [style*="background-color:#FFF"],[style*="background-color: #FFF"]){
  background-color:#fff!important;background-image:none!important;
  color:#000!important;-webkit-text-fill-color:#000!important;
  --button-text:#000!important;--text-primary:#000!important;
  --icon-color:#000!important;
}
html body :is(button,[role="button"],.btn,.light-button,.white-button,
 .btn-light,.button-light):is(
 .light-button,.white-button,.btn-light,.button-light,
 [style*="background: white"],[style*="background:white"],
 [style*="background:#fff"],[style*="background: #fff"],
 [style*="background-color: white"],[style*="background-color:#fff"],
 [style*="background-color: #fff"])
 :is(span,strong,small,i,svg,.tab-icon,.lucide,[class*="icon-"]){
  color:#000!important;-webkit-text-fill-color:#000!important;
  stroke:currentColor!important;
}
/* Solid selected actions use white fill and black text. Do not fill tabs
   and history/graph selectors that are deliberately text-only. */
html body :is(.eta-entry-btn,.settings-action.primary,.general-theme-reset,
 .ui-design-option.is-selected,.theme-preset-filter-btn.is-selected,
 button.btn-primary,button.primary-button):is(
 .active,.selected,.is-selected,[aria-pressed="true"],[aria-selected="true"]),
html body :is(button.btn-primary,button.primary-button,.white-button,.btn-light){
  background:#fff!important;background-image:none!important;
  color:#000!important;-webkit-text-fill-color:#000!important;
  border-color:#fff!important;
}
html body :is(.eta-entry-btn,.settings-action.primary,.general-theme-reset,
 .ui-design-option.is-selected,.theme-preset-filter-btn.is-selected,
 button.btn-primary,button.primary-button):is(
 .active,.selected,.is-selected,[aria-pressed="true"],[aria-selected="true"])
 :is(span,strong,small,i,svg,.lucide,[class*="icon-"]),
html body :is(button.btn-primary,button.primary-button,.white-button,.btn-light)
 :is(span,strong,small,i,svg,.lucide,[class*="icon-"]){
  color:#000!important;-webkit-text-fill-color:#000!important;
  stroke:currentColor!important;
}
/* Progress tabs: strip legacy blue gradients, fills, blue CSS vars and
   inline selected-state tints. Preserve their sizing and click behavior. */
html body #graph-tab .progress-mode-card-grid .progress-mode-card,
html body #graph-tab .progress-mode-card-grid .progress-mode-card.active,
html body #graph-tab .progress-mode-card-grid .progress-mode-card[aria-pressed="true"]{
  --mode-accent:#fff!important;--mode-rgb:255,255,255!important;
  --accent:#fff!important;--theme-primary:#fff!important;
  background:transparent!important;background-color:transparent!important;
  background-image:none!important;box-shadow:none!important;
  border-color:rgba(255,255,255,.28)!important;
  color:#fff!important;-webkit-text-fill-color:#fff!important;
}
html body #graph-tab .progress-mode-card-grid .progress-mode-card:is(.active,[aria-pressed="true"]){
  border-color:#fff!important;
  background:#fff!important;background-image:none!important;
  color:#000!important;-webkit-text-fill-color:#000!important;
}
html body #graph-tab .progress-mode-card-grid .progress-mode-card :is(span,strong,small,svg,i){
  color:inherit!important;-webkit-text-fill-color:currentColor!important;
  stroke:currentColor!important;
}
html body #graph-tab .progress-mode-card-grid .progress-mode-card:is(.active,[aria-pressed="true"]) :is(span,strong,small,svg,i){
  color:#000!important;-webkit-text-fill-color:#000!important;
  stroke:currentColor!important;
}
/* All other Progress selectors: no blue highlight. */
html body #graph-tab :is(.progress-choice-option,.range-btn,.workout-flow-toggle,
 .workout-series-toggle,.workout-weight-option,.eta-entry-btn,
 .graph-landscape-button,.progress-choice-group button):is(
 .active,.is-active,.is-selected,.selected,[aria-pressed="true"],[aria-selected="true"]){
  --accent:#fff!important;--theme-primary:#fff!important;
  border-color:#fff!important;
}
html body #graph-tab :is(.progress-choice-option,.range-btn,.workout-flow-toggle,
 .workout-series-toggle,.workout-weight-option,.progress-choice-group button):is(
 .active,.is-active,.is-selected,.selected,[aria-pressed="true"],[aria-selected="true"]){
  background-image:none!important;color:#fff!important;
  -webkit-text-fill-color:#fff!important;
}
html body #graph-tab :is(.progress-choice-option,.range-btn,.workout-flow-toggle,
 .workout-series-toggle,.workout-weight-option,.progress-choice-group button):is(
 .active,.is-active,.is-selected,.selected,[aria-pressed="true"],[aria-selected="true"])
 :is(span,strong,small){
  color:#fff!important;-webkit-text-fill-color:#fff!important;
}
/* White-on-white is never allowed on native checked controls. */
html body :is(input[type="checkbox"],input[type="radio"]){accent-color:#fff!important}

/* Universal v3 — contrast and Calories coverage. The earlier broad white
   typography rule must not override labels inside white-filled controls. */
html body :is(#calories-tab,#calProgressView,.cal-modal,body>.cal-modal){
 --theme-primary:#fff!important;--accent:#fff!important;
 --theme-primary-rgb:255,255,255!important;
 --theme-background:#000!important;--bg-primary:#000!important;
 --text-primary:#fff!important;--text-secondary:#fff!important;
 --cal-accent:#fff!important;
 color:#fff!important;
}
html body #calories-tab :is(.cal-shell,.cal-pane,.cal-modal-panel,.cal-ring>div,
 .cal-period-hub,.cal-weight-loss-total,.cal-macros>div),
html body :is(.cal-modal-panel,.calorie-choice-card){
 background-color:#000!important;
 color:#fff!important;
}
html body :is(#calories-tab,#calProgressView,.cal-modal,body>.cal-modal)
 :is(h1,h2,h3,h4,strong,small,span,label,p,.finance-subtab,.cal-history-loss,
 .cal-calendar-button,.cal-rmr-result,.cal-period-grid strong){
 color:#fff!important;-webkit-text-fill-color:#fff!important;
}
html body :is(#calories-tab,#calProgressView,.cal-modal,body>.cal-modal)
 :is(.cal-ring,.cal-calendar-ring){
 background:conic-gradient(#fff var(--fill,0%),rgba(255,255,255,.12) 0)!important;
}
html body #calories-tab .cal-subtabs .finance-subtab.active,
html body #calories-tab .cal-rmr-units button.active,
html body #calProgressView :is(.cal-range-buttons button.active,
 .cal-history-switches button.active,.cal-history-cell.is-deficit),
html body .cal-modal .cal-calendar-day.selected{
 color:#fff!important;-webkit-text-fill-color:#fff!important;
 background:rgba(255,255,255,.09)!important;
 border-color:#fff!important;box-shadow:none!important;
}
/* Filled white controls: force every nested text node and icon to black.
   Use explicit component classes so transparent tabs remain white on black. */
html body :is(
 #calories-tab .cal-action, #calories-tab .cal-tools .cal-action,
 .cal-modal .cal-action,body>.cal-modal .cal-action,
 #calories-tab .cal-add, #calories-tab .cal-save,
 .cal-shell button.cal-action, .cal-modal button.cal-action,
 button.btn-primary,button.primary-button,button.white-button,
 button.btn-light,button.button-light,.light-button,
 .white-button,.btn-light,.button-light,
 button[style*="background: white"],button[style*="background:white"],
 button[style*="background:#fff"],button[style*="background: #fff"],
 button[style*="background:#FFF"],button[style*="background: #FFF"],
 button[style*="background-color: white"],button[style*="background-color:white"],
 button[style*="background-color:#fff"],button[style*="background-color: #fff"]
 ){
 background:#fff!important;background-image:none!important;
 color:#000!important;-webkit-text-fill-color:#000!important;
 --theme-text:#000!important;--text-primary:#000!important;
 --ui-card-title:#000!important;--ui-card-description:#000!important;
 --icon-color:#000!important;
}
html body :is(
 #calories-tab .cal-action,#calories-tab .cal-tools .cal-action,
 .cal-modal .cal-action,body>.cal-modal .cal-action,
 #calories-tab .cal-add,#calories-tab .cal-save,
 button.btn-primary,button.primary-button,button.white-button,
 button.btn-light,button.button-light,.light-button,.white-button,
 .btn-light,.button-light,
 button[style*="background: white"],button[style*="background:white"],
 button[style*="background:#fff"],button[style*="background: #fff"],
 button[style*="background-color: white"],button[style*="background-color:#fff"],
 button[style*="background-color: #fff"]
 ) :is(span,strong,small,b,i,svg,.lucide,.tab-icon,[class*="icon-"]){
 color:#000!important;-webkit-text-fill-color:#000!important;
 stroke:currentColor!important;
}
/* Buttons that are filled white when selected (including generic action
   classes) get dark text, rather than the universal white active label. */
html body :is(.cal-action,.btn-primary,.primary-button,.general-theme-reset,
 .ui-design-option.is-selected,.eta-entry-btn.active,.eta-entry-btn[aria-pressed="true"])
 :is(span,strong,small,b,i,svg,.lucide){
 color:#000!important;-webkit-text-fill-color:#000!important;
 stroke:currentColor!important;
}
/* Preserve functional hidden panels in Workout History. */
html body #graph-tab #workoutProgressView #workoutHistoryCalendar:not([hidden]){
 display:grid!important;
}
html body #graph-tab #workoutProgressView #workoutHistoryCalendar[hidden],
html body #graph-tab #workoutProgressView #workoutHistoryList[hidden],
html body #graph-tab #workoutProgressView #workoutHistoryPeriod[hidden]{
 display:none!important;
}
/* Workout card arrow selector stays white on black; rep input gets room. */
html body #workout-tab .workout-set-arrow,
html body #workout-tab .workout-set-label{
 color:#fff!important;-webkit-text-fill-color:#fff!important;
 background:transparent!important;border:0!important;box-shadow:none!important;
}
