:root {
  --fc-bg-dark: #090b0b;
  --fc-bg-dark-alt: #101514;
  --fc-surface-dark: rgba(18, 24, 22, 0.82);
  --fc-surface-dark-strong: rgba(21, 29, 26, 0.93);
  --fc-surface-dark-soft: rgba(11, 15, 14, 0.5);
  --fc-border-dark: rgba(188, 205, 198, 0.11);
  --fc-border-dark-strong: rgba(111, 134, 125, 0.24);
  --fc-text-dark: #ecf2ee;
  --fc-text-dark-soft: #d7e0db;
  --fc-text-dark-muted: #9aa9a2;
  --fc-accent: #71857d;
  --fc-accent-strong: #52645d;
  --fc-accent-soft: #d8e1dc;
  --fc-accent-wash: rgba(113, 133, 125, 0.1);
  --fc-accent-glow: rgba(82, 100, 93, 0.13);
  --fc-highlight: #2f6f5b;
  --fc-highlight-soft: #d8eee6;
  --fc-highlight-wash: rgba(47, 111, 91, 0.1);
  --fc-shadow-dark: 0 22px 48px rgba(2, 5, 4, 0.4);

  --fc-bg-light: #f2f5f3;
  --fc-bg-light-alt: #e8eeeb;
  --fc-surface-light: rgba(255, 255, 255, 0.92);
  --fc-surface-light-strong: #ffffff;
  --fc-surface-light-soft: #eef3f0;
  --fc-border-light: rgba(93, 111, 104, 0.12);
  --fc-border-light-strong: rgba(93, 111, 104, 0.2);
  --fc-text-light: #202b27;
  --fc-text-light-soft: #3f524b;
  --fc-text-light-muted: #6b7d76;
  --fc-shadow-light: 0 18px 32px rgba(31, 45, 37, 0.08);
}

meta[name="theme-color"] {
  color: #1d2422;
}

body {
  accent-color: var(--fc-accent-strong);
}

body[data-theme="dark"] {
  background:
    radial-gradient(circle at 16% 18%, rgba(88, 112, 102, 0.1) 0%, rgba(88, 112, 102, 0.04) 20%, transparent 42%),
    radial-gradient(circle at 82% 10%, rgba(60, 82, 75, 0.09) 0%, rgba(60, 82, 75, 0.03) 18%, transparent 34%),
    radial-gradient(circle at 50% 100%, rgba(74, 96, 88, 0.06) 0%, transparent 36%),
    linear-gradient(145deg, var(--fc-bg-dark) 0%, var(--fc-bg-dark-alt) 58%, #151b19 100%);
  color: var(--fc-text-dark);
}

body[data-theme="light"] {
  background:
    radial-gradient(circle at 16% 14%, rgba(47, 111, 91, 0.05) 0%, transparent 34%),
    linear-gradient(135deg, var(--fc-bg-light) 0%, var(--fc-bg-light-alt) 100%);
  color: var(--fc-text-light);
}

body[data-theme="dark"] footer {
  color: var(--fc-text-dark-muted);
}

body[data-theme="dark"] h1,
body[data-theme="dark"] .header-title,
body[data-theme="light"] h1,
body[data-theme="light"] .header-title {
  background: linear-gradient(90deg, var(--fc-accent-strong), var(--fc-accent-soft));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

body[data-theme="dark"] :is(.subtitle, .header-subtitle, .metric-label, .level-label, .task-label, .history-time, .click-hint, .live-timer, .agent-progress-text, .settings-label, .task-bullets li, .task-details-label, .library-hours-meta, .library-hours-row-note, .library-hours-footnote, .focus-save-hint, .calendar-legend, .cycle-stat-label, .history-label, .recent-activity-time),
body[data-theme="light"] :is(.subtitle, .header-subtitle, .metric-label, .level-label, .task-label, .history-time, .click-hint, .live-timer, .agent-progress-text, .settings-label, .task-bullets li, .task-details-label, .library-hours-meta, .library-hours-row-note, .library-hours-footnote, .focus-save-hint, .calendar-legend, .cycle-stat-label, .history-label, .recent-activity-time) {
  color: var(--fc-text-dark-muted);
}

body[data-theme="light"] :is(.subtitle, .header-subtitle, .metric-label, .level-label, .task-label, .history-time, .click-hint, .live-timer, .agent-progress-text, .settings-label, .task-bullets li, .task-details-label, .library-hours-meta, .library-hours-row-note, .library-hours-footnote, .focus-save-hint, .calendar-legend, .cycle-stat-label, .history-label, .recent-activity-time) {
  color: var(--fc-text-light-muted);
}

body[data-theme="dark"] :is(.nav-container, .card, .agent-card, .agent-card-modern, .status-card, .hierarchy-level, .task-container, .task-container-modern, .delegation-flow-card, .focus-cockpit-card, .focus-card, .life-card, .library-hours-status, .library-hours-row, .quick-action-btn, .settings-dropdown, .settings-container, .calendar-day, .calendar-day.today, .calendar-day.current-workout, .workout-card, .calisthenics-section, .task-details-content, .focus-settings-row input, .focus-priority-input, .focus-btn, .focus-metric, .news-card, .schedule-card, .study-card, .model-badge-card),
body[data-theme="dark"] .dashboard-header {
  background: linear-gradient(180deg, rgba(19, 24, 22, 0.88) 0%, rgba(12, 16, 15, 0.96) 100%);
  border-color: var(--fc-border-dark);
  box-shadow: inset 0 1px 0 rgba(214, 226, 220, 0.03), 0 18px 38px rgba(2, 5, 4, 0.34), 0 0 0 1px rgba(69, 92, 83, 0.05);
  backdrop-filter: blur(14px);
}

body[data-theme="light"] :is(.nav-container, .card, .agent-card, .agent-card-modern, .status-card, .hierarchy-level, .task-container, .task-container-modern, .delegation-flow-card, .focus-cockpit-card, .focus-card, .life-card, .library-hours-status, .library-hours-row, .quick-action-btn, .settings-dropdown, .settings-container, .calendar-day, .calendar-day.today, .calendar-day.current-workout, .workout-card, .calisthenics-section, .task-details-content, .focus-settings-row input, .focus-priority-input, .focus-btn, .focus-metric, .news-card, .schedule-card, .study-card, .model-badge-card),
body[data-theme="light"] .dashboard-header {
  background: var(--fc-surface-light);
  border-color: var(--fc-border-light);
  box-shadow: var(--fc-shadow-light);
}

body[data-theme="dark"] :is(.card:hover, .agent-card:hover, .agent-card-modern:hover, .status-card:hover, .workout-card:hover, .quick-action-btn:hover, .calendar-day:hover, .news-card:hover, .study-card:hover),
body[data-theme="light"] :is(.card:hover, .agent-card:hover, .agent-card-modern:hover, .status-card:hover, .workout-card:hover, .quick-action-btn:hover, .calendar-day:hover, .news-card:hover, .study-card:hover) {
  border-color: rgba(47, 111, 91, 0.48);
  box-shadow: 0 18px 34px rgba(31, 18, 21, 0.14);
  transform: translateY(-2px);
}

body[data-theme="dark"] :is(.nav-brand, .agent-name, .agent-info h3, .section-title, .status-card-title, .library-hours-status-title, .library-hours-row-day, .task-title, .metric-value, .status-card-value, .task-text, .task-details-text, .library-hours-row-time, .focus-check-item),
body[data-theme="light"] :is(.nav-brand, .agent-name, .agent-info h3, .section-title, .status-card-title, .library-hours-status-title, .library-hours-row-day, .task-title, .metric-value, .status-card-value, .task-text, .task-details-text, .library-hours-row-time, .focus-check-item) {
  color: var(--fc-text-dark);
}

body[data-theme="light"] :is(.nav-brand, .agent-name, .agent-info h3, .section-title, .status-card-title, .library-hours-status-title, .library-hours-row-day, .task-title, .metric-value, .status-card-value, .task-text, .task-details-text, .library-hours-row-time, .focus-check-item) {
  color: var(--fc-text-light);
}

body[data-theme="dark"] :is(.agent-role, .task-text.delegation, .coordination-indicator, .recent-activity-item[data-agent="rodrigo"] .recent-activity-agent, .live-activity-item[data-agent="rodrigo"] .live-activity-agent, .focus-btn.primary, .focus-preset-btn.active, a, .inline-link, .week-number, .cycle-stat-value),
body[data-theme="light"] :is(.agent-role, .task-text.delegation, .coordination-indicator, .recent-activity-item[data-agent="rodrigo"] .recent-activity-agent, .live-activity-item[data-agent="rodrigo"] .live-activity-agent, .focus-btn.primary, .focus-preset-btn.active, a, .inline-link, .week-number, .cycle-stat-value) {
  color: var(--fc-accent);
}

body[data-theme="dark"] :is(.nav-tab, .lang-btn, .theme-btn, .settings-btn, .sidebar-collapse-btn),
body[data-theme="light"] :is(.nav-tab, .lang-btn, .theme-btn, .settings-btn, .sidebar-collapse-btn) {
  color: inherit;
  border-color: transparent;
}

body[data-theme="dark"] :is(.nav-tab, .lang-btn, .theme-btn, .settings-btn, .sidebar-collapse-btn, .hero-action-btn, .primary-cta, .secondary-cta, .page-primary-action, .calendar-nav-btn, .quick-jump-btn, .back-to-top-btn, .setting-btn, #jokeBtn, .focus-btn, .focus-preset-btn, .group-selector-select, .login-input, .setting-input, .focus-settings-row input, .focus-priority-input),
body[data-theme="light"] :is(.nav-tab, .lang-btn, .theme-btn, .settings-btn, .sidebar-collapse-btn, .hero-action-btn, .primary-cta, .secondary-cta, .page-primary-action, .calendar-nav-btn, .quick-jump-btn, .back-to-top-btn, .setting-btn, #jokeBtn, .focus-btn, .focus-preset-btn, .group-selector-select, .login-input, .setting-input, .focus-settings-row input, .focus-priority-input) {
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

body[data-theme="dark"] :is(.hero-action-btn, .primary-cta, .page-primary-action, .quick-jump-btn, .back-to-top-btn, .calendar-nav-btn, .focus-btn.primary, .focus-preset-btn.active, .coordination-indicator, .model-badge-card),
body[data-theme="light"] :is(.hero-action-btn, .primary-cta, .page-primary-action, .quick-jump-btn, .back-to-top-btn, .calendar-nav-btn, .focus-btn.primary, .focus-preset-btn.active, .coordination-indicator, .model-badge-card) {
  background: var(--fc-accent-wash);
  border-color: rgba(132, 152, 145, 0.26);
  color: var(--fc-accent-soft);
}

body[data-theme="light"] :is(.hero-action-btn, .primary-cta, .page-primary-action, .quick-jump-btn, .back-to-top-btn, .calendar-nav-btn, .focus-btn.primary, .focus-preset-btn.active, .coordination-indicator, .model-badge-card) {
  color: var(--fc-accent-strong);
}

body[data-theme="dark"] :is(.nav-tab:hover, .lang-btn:hover, .theme-btn:hover, .settings-btn:hover, .sidebar-collapse-btn:hover, .hero-action-btn:hover, .primary-cta:hover, .secondary-cta:hover, .page-primary-action:hover, .calendar-nav-btn:hover, .quick-jump-btn:hover, .back-to-top-btn:hover, .setting-btn:hover, #jokeBtn:hover, .focus-btn:hover, .focus-preset-btn:hover, .nav-menu-mobile .nav-tab:hover, .nav-menu-mobile .nav-tab:active),
body[data-theme="light"] :is(.nav-tab:hover, .lang-btn:hover, .theme-btn:hover, .settings-btn:hover, .sidebar-collapse-btn:hover, .hero-action-btn:hover, .primary-cta:hover, .secondary-cta:hover, .page-primary-action:hover, .calendar-nav-btn:hover, .quick-jump-btn:hover, .back-to-top-btn:hover, .setting-btn:hover, #jokeBtn:hover, .focus-btn:hover, .focus-preset-btn:hover, .nav-menu-mobile .nav-tab:hover, .nav-menu-mobile .nav-tab:active) {
  color: var(--fc-highlight-soft);
  border-color: rgba(47, 111, 91, 0.5);
  background: var(--fc-highlight-wash);
  box-shadow: 0 10px 22px rgba(17, 61, 49, 0.16);
}

body[data-theme="light"] :is(.nav-tab:hover, .lang-btn:hover, .theme-btn:hover, .settings-btn:hover, .sidebar-collapse-btn:hover, .hero-action-btn:hover, .primary-cta:hover, .secondary-cta:hover, .page-primary-action:hover, .calendar-nav-btn:hover, .quick-jump-btn:hover, .back-to-top-btn:hover, .setting-btn:hover, #jokeBtn:hover, .focus-btn:hover, .focus-preset-btn:hover, .nav-menu-mobile .nav-tab:hover, .nav-menu-mobile .nav-tab:active) {
  color: var(--fc-highlight);
}

body[data-theme="dark"] :is(.nav-tab.active, .nav-menu-mobile .nav-tab.active, .lang-btn.active, .theme-btn.active),
body[data-theme="light"] :is(.nav-tab.active, .nav-menu-mobile .nav-tab.active, .lang-btn.active, .theme-btn.active) {
  color: var(--fc-accent-soft);
  border-color: rgba(113, 133, 125, 0.28);
  background: linear-gradient(135deg, rgba(58, 73, 68, 0.34), rgba(24, 31, 29, 0.88));
  box-shadow: inset 0 0 0 1px rgba(113, 133, 125, 0.12), 0 10px 24px rgba(3, 7, 6, 0.22);
}

body[data-theme="light"] :is(.nav-tab.active, .nav-menu-mobile .nav-tab.active, .lang-btn.active, .theme-btn.active) {
  color: var(--fc-accent-strong);
}

body[data-theme="dark"] :is(.status-text.working, .status-text.status-working, .live-badge-text, .calendar-day.today .day-number, .calendar-day.current-workout .day-number),
body[data-theme="light"] :is(.status-text.working, .status-text.status-working, .live-badge-text, .calendar-day.today .day-number, .calendar-day.current-workout .day-number) {
  color: var(--fc-accent);
}

body[data-theme="dark"] :is(.live-pulse-dot, .status-indicator.working, .status-indicator.status-working, .legend-color.today),
body[data-theme="light"] :is(.live-pulse-dot, .status-indicator.working, .status-indicator.status-working, .legend-color.today) {
  background: var(--fc-accent);
  box-shadow: 0 0 0 1px rgba(132, 152, 145, 0.32), 0 0 12px rgba(132, 152, 145, 0.16);
}

body[data-theme="dark"] :is(.status-indicator::after, .status-indicator.working::after, .status-indicator.status-working::after),
body[data-theme="light"] :is(.status-indicator::after, .status-indicator.working::after, .status-indicator.status-working::after) {
  background: radial-gradient(circle, rgba(132, 152, 145, 0.26) 0%, rgba(132, 152, 145, 0.1) 55%, rgba(132, 152, 145, 0) 100%);
}

body[data-theme="dark"] :is(.progress-fill, .agent-progress-fill, .agent-progress-fill-mini, .level-progress-fill),
body[data-theme="light"] :is(.progress-fill, .agent-progress-fill, .agent-progress-fill-mini, .level-progress-fill) {
  background: linear-gradient(90deg, var(--fc-accent-strong), var(--fc-accent));
}

body[data-theme="dark"] :is(.selected-workout, .library-hours-row.is-today, .calendar-day.today, .calendar-day.current-workout, .focus-home-card),
body[data-theme="light"] :is(.selected-workout, .library-hours-row.is-today, .calendar-day.today, .calendar-day.current-workout, .focus-home-card) {
  border-color: rgba(132, 152, 145, 0.32);
  box-shadow: 0 12px 24px rgba(45, 57, 53, 0.14);
}

body[data-theme="dark"] .library-hours-status.is-open,
body[data-theme="dark"] .library-hours-row.is-currently-open,
body[data-theme="light"] .library-hours-status.is-open,
body[data-theme="light"] .library-hours-row.is-currently-open {
  border-color: rgba(132, 152, 145, 0.32);
  background: linear-gradient(135deg, rgba(132, 152, 145, 0.12), rgba(18, 28, 23, 0.04));
}

body[data-theme="dark"] .library-hours-status.is-warning,
body[data-theme="light"] .library-hours-status.is-warning {
  border-color: rgba(191, 129, 67, 0.42);
  background: linear-gradient(135deg, rgba(191, 129, 67, 0.16), rgba(18, 28, 23, 0.04));
}

body[data-theme="dark"] .library-hours-status.is-closed,
body[data-theme="light"] .library-hours-status.is-closed {
  border-color: rgba(47, 111, 91, 0.38);
  background: linear-gradient(135deg, rgba(47, 111, 91, 0.14), rgba(18, 28, 23, 0.04));
}

body[data-theme="dark"] .library-hours-status-badge,
body[data-theme="light"] .library-hours-status-badge {
  background: rgba(19, 28, 23, 0.46);
  border-color: rgba(255, 255, 255, 0.08);
}

body[data-theme="light"] .library-hours-status-badge {
  background: var(--fc-surface-light-soft);
  border-color: var(--fc-border-light);
}

body[data-theme="light"] .mobile-menu-eyebrow,
body[data-theme="light"] #page-schedule .section-title-main {
  color: var(--fc-accent-strong);
}

body[data-theme="light"] #page-study-overview .study-preview-pill.is-active {
  border-color: rgba(113, 133, 125, 0.28);
  box-shadow: 0 0 0 1px rgba(113, 133, 125, 0.12) inset, 0 12px 26px rgba(45, 57, 53, 0.08);
  background: linear-gradient(180deg, #f6faf7 0%, #ffffff 100%);
}

body[data-theme="light"] #page-study-overview .study-review-week.is-current {
  border-color: rgba(113, 133, 125, 0.3);
  background: linear-gradient(180deg, #f4f8f5 0%, #ffffff 100%);
  box-shadow: 0 14px 30px rgba(45, 57, 53, 0.08);
}

body[data-theme="light"] #page-study-overview .study-session-chip {
  background: rgba(113, 133, 125, 0.12);
  border-color: rgba(113, 133, 125, 0.22);
  color: var(--fc-accent-strong);
}

body[data-theme="dark"] :is(.nav-brand:focus-visible, .sidebar-collapse-btn:focus-visible, .quick-jump-btn:focus-visible, .back-to-top-btn:focus-visible, .nav-tab:focus-visible, .agent-card:focus-visible, .hero-action-btn:focus-visible, .calendar-nav-btn:focus-visible, .settings-btn:focus-visible, .primary-cta:focus-visible, .secondary-cta:focus-visible, .page-primary-action:focus-visible, .group-selector-select:focus-visible, .setting-input:focus-visible, .login-input:focus-visible, .focus-btn:focus-visible),
body[data-theme="light"] :is(.nav-brand:focus-visible, .sidebar-collapse-btn:focus-visible, .quick-jump-btn:focus-visible, .back-to-top-btn:focus-visible, .nav-tab:focus-visible, .agent-card:focus-visible, .hero-action-btn:focus-visible, .calendar-nav-btn:focus-visible, .settings-btn:focus-visible, .primary-cta:focus-visible, .secondary-cta:focus-visible, .page-primary-action:focus-visible, .group-selector-select:focus-visible, .setting-input:focus-visible, .login-input:focus-visible, .focus-btn:focus-visible) {
  outline-color: var(--fc-accent);
  box-shadow: 0 0 0 3px rgba(132, 152, 145, 0.2);
}

body[data-theme="dark"] {
  --home-shell-surface: linear-gradient(180deg, rgba(14, 17, 17, 0.975) 0%, rgba(8, 10, 10, 0.995) 100%);
  --home-shell-surface-soft: linear-gradient(180deg, rgba(19, 23, 22, 0.95) 0%, rgba(10, 13, 12, 0.987) 100%);
  --home-shell-border: rgba(182, 193, 188, 0.1);
  --home-shell-border-strong: rgba(130, 152, 144, 0.18);
  --home-shell-shadow: 0 18px 44px rgba(0, 0, 0, 0.44);
  --home-shell-radius-lg: 12px;
  --home-shell-radius-md: 9px;
  --home-shell-radius-sm: 7px;
}

body[data-theme="dark"] .nav-container {
  background: var(--home-shell-surface);
  border-right-color: var(--home-shell-border);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.02);
}

body[data-theme="light"] .nav-container {
  background: rgba(251, 252, 251, 0.92);
  border-right-color: rgba(54, 80, 68, 0.08);
}

body[data-theme="dark"] .nav-brand,
body[data-theme="dark"] .nav-brand-label {
  color: #f3f6f4;
}

body[data-theme="dark"] .nav-brand-icon,
body[data-theme="dark"] .nav-brand-reopen-icon {
  color: #d8dfdb;
}

body[data-theme="dark"] .sidebar-collapse-btn {
  background: rgba(255, 255, 255, 0.035);
  border-color: var(--home-shell-border);
  color: #d7dfdb;
  border-radius: var(--home-shell-radius-md);
}

body[data-theme="dark"] .sidebar-collapse-btn:hover {
  background: rgba(255, 255, 255, 0.065);
  border-color: rgba(138, 110, 116, 0.28);
  color: #f3f6f4;
}

body[data-theme="light"] .sidebar-collapse-btn {
  background: rgba(245, 248, 246, 0.96);
  border-color: rgba(76, 107, 92, 0.16);
}

body[data-theme="dark"] .nav-tab {
  color: #aab5b0;
  border-radius: var(--home-shell-radius-md);
}

body[data-theme="dark"] .nav-tab:hover,
body[data-theme="dark"] .nav-menu-mobile .nav-tab:hover {
  color: #eef3f0;
  background: rgba(255, 255, 255, 0.05);
}

body[data-theme="dark"] .nav-tab.active,
body[data-theme="dark"] .nav-menu-mobile .nav-tab.active {
  color: #f3f6f4;
  background: linear-gradient(180deg, rgba(38, 47, 44, 0.96) 0%, rgba(20, 25, 24, 0.99) 100%);
  border-color: var(--home-shell-border-strong);
  box-shadow: inset 0 1px 0 rgba(219, 228, 223, 0.04), 0 10px 22px rgba(3, 7, 6, 0.22);
}

body[data-theme="dark"] .settings-container,
body[data-theme="dark"] .mobile-menu-header,
body[data-theme="dark"] .nav-menu-mobile .settings-divider {
  border-color: var(--home-shell-border);
}

body[data-theme="dark"] .settings-btn,
body[data-theme="dark"] .settings-dropdown,
body[data-theme="dark"] .nav-menu-mobile,
body[data-theme="dark"] .mobile-menu-close {
  background: var(--home-shell-surface-soft);
  border-color: var(--home-shell-border);
  box-shadow: var(--home-shell-shadow);
}

body[data-theme="dark"] .settings-btn {
  color: #d8dfdb;
  border-radius: var(--home-shell-radius-md);
}

body[data-theme="dark"] .settings-btn:hover,
body[data-theme="dark"] .mobile-menu-close:hover,
body[data-theme="dark"] .mobile-menu-close:focus-visible {
  background: linear-gradient(180deg, rgba(37, 40, 43, 0.96) 0%, rgba(22, 25, 27, 0.99) 100%);
  border-color: rgba(138, 110, 116, 0.28);
  color: #f3f6f4;
}

body[data-theme="dark"] .settings-btn-icon,
body[data-theme="dark"] .settings-user-avatar,
body[data-theme="dark"] .mobile-menu-close {
  background: rgba(255, 255, 255, 0.04);
}

body[data-theme="dark"] .nav-menu-mobile {
  background: var(--home-shell-surface);
}

/* Keep the desktop rail on the minimal near-black shell even though the broader
   staging-forest surface rules still tint shared surfaces slightly green. */
body[data-theme="dark"] .nav-container,
body[data-theme="dark"] .nav-container .settings-container {
  background: var(--home-shell-surface);
  border-color: var(--home-shell-border);
  box-shadow: none;
}

body[data-theme="dark"] .nav-container .settings-container {
  background: transparent;
  border-top-color: var(--home-shell-border);
}

body[data-theme="dark"] .nav-container .nav-tab {
  color: #aab5b0;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

body[data-theme="dark"] .nav-container .nav-tab:hover,
body[data-theme="dark"] .nav-container .nav-tab:focus-visible {
  color: #eef3f0;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

body[data-theme="dark"] .nav-container .nav-tab.active {
  color: #f3f6f4;
  background: linear-gradient(180deg, rgba(42, 45, 48, 0.96) 0%, rgba(26, 28, 31, 0.99) 100%);
  border-color: var(--home-shell-border-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body[data-theme="dark"] .nav-container .sidebar-collapse-btn,
body[data-theme="dark"] .nav-container .settings-btn,
body[data-theme="dark"] .nav-container .settings-dropdown {
  background: var(--home-shell-surface-soft);
  border-color: var(--home-shell-border);
}

body[data-theme="dark"] .nav-container .settings-dropdown {
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.42);
}

body[data-theme="dark"] .backdrop,
body[data-theme="dark"] .modal-content,
body[data-theme="light"] .modal-content {
  backdrop-filter: blur(18px);
}

body[data-theme="dark"] .modal-overlay {
  background: rgba(0, 0, 0, 0.78);
}

body[data-theme="dark"] #agentModal .modal-content {
  background: var(--home-shell-surface);
  border-color: var(--home-shell-border);
  border-radius: var(--home-shell-radius-lg);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);
}

body[data-theme="dark"] #agentModal .modal-header,
body[data-theme="dark"] #agentModal .agent-stats-section,
body[data-theme="dark"] #agentModal .model-section {
  border-color: var(--home-shell-border);
}

body[data-theme="dark"] #agentModal .modal-header {
  background: linear-gradient(180deg, rgba(24, 27, 29, 0.9) 0%, rgba(16, 18, 20, 0.72) 100%);
}

body[data-theme="dark"] #agentModal .modal-icon,
body[data-theme="dark"] #agentModal .current-status,
body[data-theme="dark"] #agentModal .history-item,
body[data-theme="dark"] #agentModal .task-context-card,
body[data-theme="dark"] #agentModal .task-progress-entry,
body[data-theme="dark"] #agentModal .delegation-flow,
body[data-theme="dark"] #agentModal .agent-stat-item,
body[data-theme="dark"] #agentModal .model-select,
body[data-theme="dark"] #agentModal .live-activity-section {
  background: var(--home-shell-surface-soft);
  border: 1px solid var(--home-shell-border);
  border-radius: var(--home-shell-radius-md);
  box-shadow: none;
}

body[data-theme="dark"] #agentModal .modal-title h2,
body[data-theme="dark"] #agentModal .current-task,
body[data-theme="dark"] #agentModal .history-task,
body[data-theme="dark"] #agentModal .task-context-pre,
body[data-theme="dark"] #agentModal .task-context-list,
body[data-theme="dark"] #agentModal .task-progress-text,
body[data-theme="dark"] #agentModal .history-subtask,
body[data-theme="dark"] #agentModal .model-value {
  color: #e7ede9;
}

body[data-theme="dark"] #agentModal .section-title,
body[data-theme="dark"] #agentModal .history-time,
body[data-theme="dark"] #agentModal .task-context-label,
body[data-theme="dark"] #agentModal .task-progress-time,
body[data-theme="dark"] #agentModal .model-label,
body[data-theme="dark"] #agentModal .agent-stat-label,
body[data-theme="dark"] #agentModal .status-section .last-update,
body[data-theme="dark"] #agentModal .live-progress-label,
body[data-theme="dark"] #agentModal .live-activity-timer {
  color: #8f9a95;
}

body[data-theme="dark"] #agentModal .modal-title .role,
body[data-theme="dark"] #agentModal .delegation-task-label,
body[data-theme="dark"] #agentModal .agent-stat-value,
body[data-theme="dark"] #agentModal .model-badge {
  color: #d7dfdb;
}

body[data-theme="dark"] #agentModal .model-badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--home-shell-border);
}

body[data-theme="dark"] #agentModal .close-btn {
  color: #aab5b0;
  border-radius: var(--home-shell-radius-sm);
}

body[data-theme="dark"] #agentModal .close-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f3f6f4;
}

body[data-theme="dark"] #agentModal .live-progress-bar {
  background: rgba(255, 255, 255, 0.07);
}

body[data-theme="dark"] #agentModal .live-progress-fill {
  background: linear-gradient(90deg, rgba(123, 149, 137, 0.92) 0%, rgba(176, 185, 180, 0.92) 100%);
}

body[data-theme="dark"] #agentModal .status-badge.working {
  background: rgba(108, 92, 58, 0.45);
  color: #ebcf8b;
}

body[data-theme="dark"] #agentModal .status-badge.idle {
  background: rgba(57, 63, 68, 0.7);
  color: #bac4bf;
}

body[data-theme="dark"] .agent-card.rodrigo,
body[data-theme="light"] .agent-card.rodrigo {
  --agent-color: var(--fc-accent);
}

body[data-theme="dark"] .agent-card.helios,
body[data-theme="light"] .agent-card.helios {
  --agent-color: var(--fc-highlight);
}

body[data-theme="dark"] .live-badge,
body[data-theme="light"] .live-badge {
  background: var(--fc-accent-wash);
  border-color: rgba(132, 152, 145, 0.26);
}

body[data-theme="dark"] .recent-activities-count,
body[data-theme="light"] .recent-activities-count {
  background: color-mix(in srgb, var(--fc-accent-wash) 88%, transparent);
  border: 1px solid rgba(132, 152, 145, 0.26);
  color: var(--fc-accent-soft);
  box-shadow: inset 0 0 0 1px rgba(132, 152, 145, 0.08);
}

body[data-theme="light"] .recent-activities-count {
  color: var(--fc-accent-strong);
}

body[data-theme="dark"] .recent-activity-item,
body[data-theme="light"] .recent-activity-item {
  background: color-mix(in srgb, var(--fc-surface-dark-strong) 74%, transparent);
  border-left-color: rgba(132, 152, 145, 0.26);
}

body[data-theme="light"] .recent-activity-item {
  background: color-mix(in srgb, var(--fc-surface-light) 94%, transparent);
}

body[data-theme="dark"] .recent-activity-item:hover,
body[data-theme="light"] .recent-activity-item:hover {
  background: color-mix(in srgb, var(--fc-highlight-wash) 72%, var(--fc-accent-wash) 28%);
  border-left-color: rgba(47, 111, 91, 0.5);
}

body[data-theme="dark"] .history-item.activity,
body[data-theme="light"] .history-item.activity,
body[data-theme="dark"] .recent-activity-item.activity,
body[data-theme="light"] .recent-activity-item.activity {
  border-color: rgba(132, 152, 145, 0.24);
}

body[data-theme="dark"] .history-item.delegation,
body[data-theme="light"] .history-item.delegation,
body[data-theme="dark"] .recent-activity-item.delegation,
body[data-theme="light"] .recent-activity-item.delegation {
  border-color: rgba(47, 111, 91, 0.34);
}


body[data-theme="dark"] .login-card,
body[data-theme="dark"] .admin-section,
body[data-theme="dark"] .admin-sidebar,
body[data-theme="dark"] .admin-mini-card,
body[data-theme="dark"] .admin-health-item,
body[data-theme="dark"] .admin-cron-item,
body[data-theme="dark"] .admin-user-card,
body[data-theme="dark"] .quick-note-card,
body[data-theme="dark"] .admin-modal-content,
body[data-theme="dark"] .admin-notification {
  background: var(--fc-surface-dark-strong);
  border-color: var(--fc-border-dark);
  box-shadow: var(--fc-shadow-dark);
}

body[data-theme="light"] .login-card,
body[data-theme="light"] .admin-section,
body[data-theme="light"] .admin-sidebar,
body[data-theme="light"] .admin-mini-card,
body[data-theme="light"] .admin-health-item,
body[data-theme="light"] .admin-cron-item,
body[data-theme="light"] .admin-user-card,
body[data-theme="light"] .quick-note-card,
body[data-theme="light"] .admin-modal-content,
body[data-theme="light"] .admin-notification {
  background: var(--fc-surface-light);
  border-color: var(--fc-border-light);
  box-shadow: var(--fc-shadow-light);
}

body[data-theme="dark"] :is(.admin-sidebar-btn.active, .admin-btn-primary, .login-submit),
body[data-theme="light"] :is(.admin-sidebar-btn.active, .admin-btn-primary, .login-submit) {
  background: linear-gradient(135deg, rgba(93, 111, 104, 0.26), rgba(132, 152, 145, 0.14));
  border-color: rgba(132, 152, 145, 0.3);
  color: var(--fc-accent-soft);
}

body[data-theme="light"] :is(.admin-sidebar-btn.active, .admin-btn-primary, .login-submit) {
  color: var(--fc-accent-strong);
}

body[data-theme="dark"] :is(.admin-btn-secondary, .admin-input, .admin-select, .login-input, .password-toggle, .admin-modal-close),
body[data-theme="light"] :is(.admin-btn-secondary, .admin-input, .admin-select, .login-input, .password-toggle, .admin-modal-close) {
  background: color-mix(in srgb, var(--fc-surface-dark-strong) 88%, transparent);
  border-color: var(--fc-border-dark-strong);
  color: inherit;
}

body[data-theme="light"] :is(.admin-btn-secondary, .admin-input, .admin-select, .login-input, .password-toggle, .admin-modal-close) {
  background: color-mix(in srgb, var(--fc-surface-light-strong) 96%, transparent);
  border-color: var(--fc-border-light-strong);
}

body[data-theme="dark"] :is(.admin-btn:hover, .admin-sidebar-btn:hover, .login-submit:hover, .password-toggle:hover, .admin-modal-close:hover),
body[data-theme="light"] :is(.admin-btn:hover, .admin-sidebar-btn:hover, .login-submit:hover, .password-toggle:hover, .admin-modal-close:hover) {
  border-color: rgba(47, 111, 91, 0.5);
  background: var(--fc-highlight-wash);
  color: var(--fc-highlight-soft);
}

body[data-theme="light"] :is(.admin-btn:hover, .admin-sidebar-btn:hover, .login-submit:hover, .password-toggle:hover, .admin-modal-close:hover) {
  color: var(--fc-highlight);
}

body[data-theme="dark"] .admin-user-card.current-user,
body[data-theme="light"] .admin-user-card.current-user,
body[data-theme="dark"] .quick-note-card.pinned,
body[data-theme="light"] .quick-note-card.pinned {
  border-color: rgba(132, 152, 145, 0.32);
  box-shadow: 0 12px 24px rgba(45, 57, 53, 0.12);
}

body[data-theme="dark"] .role-badge.admin,
body[data-theme="light"] .role-badge.admin {
  background: rgba(47, 111, 91, 0.18);
  border-color: rgba(47, 111, 91, 0.34);
  color: var(--fc-highlight-soft);
}

body[data-theme="light"] .role-badge.admin {
  color: var(--fc-highlight);
}

body[data-theme="dark"] .role-badge.user,
body[data-theme="light"] .role-badge.user {
  background: rgba(132, 152, 145, 0.12);
  border-color: rgba(132, 152, 145, 0.26);
  color: var(--fc-accent-soft);
}

body[data-theme="light"] .role-badge.user {
  color: var(--fc-accent-strong);
}

/* Production palette sweep: legacy blue/cyan overrides */
body[data-theme="dark"] :is(.live-badge, .live-timer-container, .live-activity-section, .recent-activity-item.status-working, .recent-activity-item.status-info, .live-activity-item.status-working, .live-activity-item.status-info),
body[data-theme="light"] :is(.live-badge, .live-timer-container, .live-activity-section, .recent-activity-item.status-working, .recent-activity-item.status-info, .live-activity-item.status-working, .live-activity-item.status-info) {
  border-color: rgba(132, 152, 145, 0.26);
  background: color-mix(in srgb, var(--fc-accent-wash) 86%, transparent);
}

body[data-theme="dark"] :is(.live-progress-fill, .live-progress-bar .live-progress-fill, .nutrition-progress-track span, .schedule-progress-fill),
body[data-theme="light"] :is(.live-progress-fill, .live-progress-bar .live-progress-fill, .nutrition-progress-track span, .schedule-progress-fill) {
  background: linear-gradient(90deg, var(--fc-accent-strong), var(--fc-accent));
}

body[data-theme="dark"] :is(.live-activity-dot, .live-dot, .live-dot-pulse, .live-activity-badge::before),
body[data-theme="light"] :is(.live-activity-dot, .live-dot, .live-dot-pulse, .live-activity-badge::before) {
  background: var(--fc-accent);
  box-shadow: 0 0 0 1px rgba(132, 152, 145, 0.34), 0 0 14px rgba(132, 152, 145, 0.16);
}

body[data-theme="dark"] :is(.recent-activity-item[data-agent="rodrigo"] .recent-activity-agent, .live-activity-item[data-agent="rodrigo"] .live-activity-agent, .schedule-date, .schedule-modal-time, .schedule-mini-time, .schedule-today-badge, .schedule-today-badge-inline, .schedule-week-range),
body[data-theme="light"] :is(.recent-activity-item[data-agent="rodrigo"] .recent-activity-agent, .live-activity-item[data-agent="rodrigo"] .live-activity-agent, .schedule-date, .schedule-modal-time, .schedule-mini-time, .schedule-today-badge, .schedule-today-badge-inline, .schedule-week-range) {
  color: var(--fc-accent);
}

body[data-theme="light"] :is(.recent-activity-item[data-agent="rodrigo"] .recent-activity-agent, .live-activity-item[data-agent="rodrigo"] .live-activity-agent, .schedule-date, .schedule-modal-time, .schedule-mini-time, .schedule-today-badge, .schedule-today-badge-inline, .schedule-week-range) {
  color: var(--fc-accent-strong);
}

body[data-theme="dark"] :is(.schedule-event.type-lecture, .schedule-modal-event.type-lecture, .schedule-mini-event.type-lecture, .schedule-event.today, .schedule-day-card.today, .schedule-event.current, .schedule-mini-event.current, .schedule-modal-event.current, .selected-workout),
body[data-theme="light"] :is(.schedule-event.type-lecture, .schedule-modal-event.type-lecture, .schedule-mini-event.type-lecture, .schedule-event.today, .schedule-day-card.today, .schedule-event.current, .schedule-mini-event.current, .schedule-modal-event.current, .selected-workout) {
  border-color: rgba(132, 152, 145, 0.38);
  border-left-color: var(--fc-accent);
  box-shadow: 0 10px 24px rgba(45, 57, 53, 0.1);
}

body[data-theme="dark"] :is(.schedule-event.next, .schedule-mini-event.next, .schedule-modal-event.next, .schedule-week-nav-btn:hover, .schedule-week-nav-btn:focus-visible, .nutrition-slot-card.active, .nutrition-period-day-card.active),
body[data-theme="light"] :is(.schedule-event.next, .schedule-mini-event.next, .schedule-modal-event.next, .schedule-week-nav-btn:hover, .schedule-week-nav-btn:focus-visible, .nutrition-slot-card.active, .nutrition-period-day-card.active) {
  border-color: rgba(47, 111, 91, 0.46);
  background: color-mix(in srgb, var(--fc-highlight-wash) 88%, transparent);
  box-shadow: inset 0 0 0 1px rgba(47, 111, 91, 0.18);
}

body[data-theme="dark"] :is(.schedule-type.type-lecture, .nutrition-food-chip, .nutrition-slot-add-btn, .nutrition-edit-btn, .nutrition-cancel-btn),
body[data-theme="light"] :is(.schedule-type.type-lecture, .nutrition-food-chip, .nutrition-slot-add-btn, .nutrition-edit-btn, .nutrition-cancel-btn) {
  background: color-mix(in srgb, var(--fc-accent-wash) 92%, transparent);
  border-color: rgba(132, 152, 145, 0.26);
  color: var(--fc-accent-soft);
}

body[data-theme="light"] :is(.schedule-type.type-lecture, .nutrition-food-chip, .nutrition-slot-add-btn, .nutrition-edit-btn, .nutrition-cancel-btn) {
  color: var(--fc-accent-strong);
}

body[data-theme="dark"] :is(.schedule-type.type-seminar, .quick-note-badge.followup, .quick-note-mode-badge, .nutrition-delete-btn),
body[data-theme="light"] :is(.schedule-type.type-seminar, .quick-note-badge.followup, .quick-note-mode-badge, .nutrition-delete-btn) {
  background: color-mix(in srgb, var(--fc-highlight-wash) 92%, transparent);
  border-color: rgba(47, 111, 91, 0.34);
  color: var(--fc-highlight-soft);
}

body[data-theme="light"] :is(.schedule-type.type-seminar, .quick-note-badge.followup, .quick-note-mode-badge, .nutrition-delete-btn) {
  color: var(--fc-highlight);
}

body[data-theme="dark"] #page-nutrition :is(.nutrition-inline-composer, .nutrition-slot-card, .nutrition-entry-item, .nutrition-period-day-card, .nutrition-detail-card, .nutrition-trend-card, .nutrition-settings-modal, .nutrition-profile-disclosure, .nutrition-busy-state),
body[data-theme="light"] #page-nutrition :is(.nutrition-inline-composer, .nutrition-slot-card, .nutrition-entry-item, .nutrition-period-day-card, .nutrition-detail-card, .nutrition-trend-card, .nutrition-settings-modal, .nutrition-profile-disclosure, .nutrition-busy-state) {
  border-color: rgba(132, 152, 145, 0.16);
}

body[data-theme="dark"] #page-nutrition :is(.nutrition-period-day-card:hover, .nutrition-entry-item:hover, .nutrition-settings-close-btn:hover),
body[data-theme="light"] #page-nutrition :is(.nutrition-period-day-card:hover, .nutrition-entry-item:hover, .nutrition-settings-close-btn:hover) {
  border-color: rgba(47, 111, 91, 0.46);
}

body[data-theme="dark"] #page-nutrition :is(.nutrition-slot-inline-composer, .nutrition-busy-state),
body[data-theme="light"] #page-nutrition :is(.nutrition-slot-inline-composer, .nutrition-busy-state) {
  border-color: rgba(132, 152, 145, 0.26);
  background: linear-gradient(180deg, rgba(28, 49, 39, 0.38) 0%, rgba(19, 29, 24, 0.72) 100%);
  box-shadow: inset 0 0 0 1px rgba(132, 152, 145, 0.08);
}

body[data-theme="light"] #page-nutrition :is(.nutrition-slot-inline-composer, .nutrition-busy-state) {
  background: linear-gradient(180deg, rgba(220, 235, 227, 0.72) 0%, rgba(255, 255, 255, 0.98) 100%);
}

body[data-theme="dark"] #page-nutrition .nutrition-spinner,
body[data-theme="light"] #page-nutrition .nutrition-spinner {
  border-color: rgba(47, 111, 91, 0.18);
  border-top-color: var(--fc-accent);
}

body[data-theme="dark"] #page-nutrition .nutrition-macro-stack,
body[data-theme="light"] #page-nutrition .nutrition-macro-stack {
  background: color-mix(in srgb, var(--fc-surface-dark-strong) 86%, transparent);
}

body[data-theme="dark"] #page-nutrition .nutrition-macro-stack .protein,
body[data-theme="light"] #page-nutrition .nutrition-macro-stack .protein { background: var(--fc-accent); }
body[data-theme="dark"] #page-nutrition .nutrition-macro-stack .carbs,
body[data-theme="light"] #page-nutrition .nutrition-macro-stack .carbs { background: var(--fc-highlight); }
body[data-theme="dark"] #page-nutrition .nutrition-macro-stack .fat,
body[data-theme="light"] #page-nutrition .nutrition-macro-stack .fat { background: #b48143; }

body[data-theme="dark"] :is(.workout-badge.pull, .exercise-icon.pull, .week-type.normal, .legend-color.today),
body[data-theme="light"] :is(.workout-badge.pull, .exercise-icon.pull, .week-type.normal, .legend-color.today) {
  background: color-mix(in srgb, var(--fc-accent-wash) 92%, transparent);
  border-color: rgba(132, 152, 145, 0.28);
  color: var(--fc-accent-soft);
}

body[data-theme="light"] :is(.workout-badge.pull, .exercise-icon.pull, .week-type.normal, .legend-color.today) {
  color: var(--fc-accent-strong);
}

body[data-theme="dark"] :is(.legend-color.front-lever, .agent-card.helios .agent-role, .recent-activity-item[data-agent="helios"] .recent-activity-agent, .live-activity-item[data-agent="helios"] .live-activity-agent),
body[data-theme="light"] :is(.legend-color.front-lever, .agent-card.helios .agent-role, .recent-activity-item[data-agent="helios"] .recent-activity-agent, .live-activity-item[data-agent="helios"] .live-activity-agent) {
  color: var(--fc-highlight);
  background: color-mix(in srgb, var(--fc-highlight-wash) 92%, transparent);
  border-color: rgba(47, 111, 91, 0.34);
}

body[data-theme="dark"] :is(.primary-cta, .hero-action-btn),
body[data-theme="light"] :is(.primary-cta, .hero-action-btn) {
  background: color-mix(in srgb, var(--fc-accent-wash) 90%, transparent);
  border-color: rgba(132, 152, 145, 0.26);
  color: var(--fc-accent-soft);
}

body[data-theme="light"] :is(.primary-cta, .hero-action-btn) {
  color: var(--fc-accent-strong);
}

body[data-theme="dark"] :is(.primary-cta:hover, .hero-action-btn:hover),
body[data-theme="light"] :is(.primary-cta:hover, .hero-action-btn:hover) {
  background: color-mix(in srgb, var(--fc-highlight-wash) 92%, transparent);
  border-color: rgba(47, 111, 91, 0.48);
  color: var(--fc-highlight-soft);
}

body[data-theme="light"] :is(.primary-cta:hover, .hero-action-btn:hover) {
  color: var(--fc-highlight);
}

body[data-theme="dark"] #page-nutrition .hero-action-btn,
body[data-theme="light"] #page-nutrition .hero-action-btn,
body[data-theme="dark"] #page-nutrition .nutrition-slot-add-btn,
body[data-theme="light"] #page-nutrition .nutrition-slot-add-btn,
body[data-theme="dark"] #page-nutrition .nutrition-edit-btn,
body[data-theme="light"] #page-nutrition .nutrition-edit-btn,
body[data-theme="dark"] #page-nutrition .nutrition-cancel-btn,
body[data-theme="light"] #page-nutrition .nutrition-cancel-btn {
  background: color-mix(in srgb, var(--fc-accent-wash) 92%, transparent);
  border-color: rgba(132, 152, 145, 0.26);
  color: var(--fc-accent-strong);
}

body[data-theme="dark"] #page-nutrition .hero-action-btn:hover,
body[data-theme="light"] #page-nutrition .hero-action-btn:hover,
body[data-theme="dark"] #page-nutrition .nutrition-slot-add-btn:hover,
body[data-theme="light"] #page-nutrition .nutrition-slot-add-btn:hover,
body[data-theme="dark"] #page-nutrition .nutrition-edit-btn:hover,
body[data-theme="light"] #page-nutrition .nutrition-edit-btn:hover,
body[data-theme="dark"] #page-nutrition .nutrition-cancel-btn:hover,
body[data-theme="light"] #page-nutrition .nutrition-cancel-btn:hover {
  background: color-mix(in srgb, var(--fc-highlight-wash) 92%, transparent);
  border-color: rgba(47, 111, 91, 0.46);
  color: var(--fc-highlight);
}

body[data-theme="dark"] #page-nutrition .nutrition-delete-btn,
body[data-theme="light"] #page-nutrition .nutrition-delete-btn {
  background: color-mix(in srgb, var(--fc-highlight-wash) 92%, transparent);
  border-color: rgba(47, 111, 91, 0.34);
  color: var(--fc-highlight);
}

body[data-theme="dark"] #page-nutrition .nutrition-progress-track span,
body[data-theme="light"] #page-nutrition .nutrition-progress-track span {
  background: linear-gradient(90deg, var(--fc-accent) 0%, var(--fc-highlight) 100%);
}

body[data-theme="dark"] #page-nutrition .nutrition-slot-card.active,
body[data-theme="light"] #page-nutrition .nutrition-slot-card.active,
body[data-theme="dark"] #page-nutrition .nutrition-period-day-card.active,
body[data-theme="light"] #page-nutrition .nutrition-period-day-card.active {
  border-color: rgba(47, 111, 91, 0.46);
  background: color-mix(in srgb, var(--fc-highlight-wash) 88%, transparent);
  box-shadow: inset 0 0 0 1px rgba(47, 111, 91, 0.18);
}

/* Dark-mode production sweep: catch remaining legacy blue/cyan accents that escape older base styles */
body[data-theme="dark"] .header-title {
  background: linear-gradient(90deg, var(--fc-accent-strong), var(--fc-accent-soft));
  -webkit-background-clip: text;
  background-clip: text;
}

body[data-theme="dark"] :is(
  .nav-brand:focus-visible,
  .sidebar-collapse-btn:focus-visible,
  .nav-tab:focus-visible,
  .hero-action-btn:focus-visible,
  .calendar-nav-btn:focus-visible,
  .settings-btn:focus-visible,
  .primary-cta:focus-visible,
  .secondary-cta:focus-visible,
  .page-primary-action:focus-visible,
  .group-selector-select:focus-visible,
  .setting-input:focus-visible,
  .login-input:focus-visible,
  .focus-btn:focus-visible,
  .mobile-menu-close:focus-visible,
  .backup-form-group input:focus,
  .model-select:focus
) {
  outline-color: var(--fc-accent);
  border-color: rgba(132, 152, 145, 0.36);
  box-shadow: 0 0 0 3px rgba(132, 152, 145, 0.18);
}

body[data-theme="dark"] :is(
  .focus-btn.primary,
  .focus-preset-btn.active,
  .model-badge,
  .model-badge-card,
  .model-switch-btn,
  .live-badge,
  .status-badge-live,
  .schedule-type.type-lecture,
  .nutrition-food-chip,
  .nutrition-slot-add-btn,
  .nutrition-edit-btn,
  .nutrition-cancel-btn,
  .setting-btn,
  #jokeBtn,
  .primary-cta,
  .hero-action-btn
) {
  background: color-mix(in srgb, var(--fc-accent-wash) 92%, transparent);
  border-color: rgba(132, 152, 145, 0.28);
  color: var(--fc-accent-soft);
}

body[data-theme="dark"] :is(
  .focus-btn.primary:hover,
  .focus-preset-btn.active:hover,
  .model-switch-btn:hover,
  .setting-btn:hover,
  #jokeBtn:hover,
  .primary-cta:hover,
  .hero-action-btn:hover,
  .quick-action-btn:hover
) {
  background: color-mix(in srgb, var(--fc-highlight-wash) 92%, transparent);
  border-color: rgba(47, 111, 91, 0.46);
  color: var(--fc-highlight-soft);
}

body[data-theme="dark"] .model-select:hover {
  border-color: rgba(132, 152, 145, 0.24);
}

body[data-theme="dark"] .model-switch-btn {
  background-image: linear-gradient(135deg, rgba(93, 111, 104, 0.88) 0%, rgba(132, 152, 145, 0.82) 100%);
  color: #102018;
}

body[data-theme="dark"] .model-switch-btn:hover {
  background-image: linear-gradient(135deg, rgba(47, 111, 91, 0.9) 0%, rgba(111, 169, 148, 0.82) 100%);
}

body[data-theme="dark"] :is(
  .agent-progress-fill,
  .agent-progress-fill-mini,
  .progress-fill,
  .live-progress-fill,
  .schedule-progress-fill,
  .nutrition-progress-track span
) {
  background: linear-gradient(90deg, var(--fc-accent-strong), var(--fc-accent));
}

body[data-theme="dark"] :is(
  .live-activity-item[data-level="1"],
  .recent-activity-item.status-info,
  .live-activity-item.status-info,
  .history-item.activity,
  .recent-activity-item.activity,
  .live-activity-section,
  .recent-activities-section,
  .live-activity-item.new,
  .recent-activity-item.new
) {
  border-color: rgba(132, 152, 145, 0.22);
}

body[data-theme="dark"] .live-activity-item[data-level="1"] {
  border-left-color: var(--fc-accent);
  background: linear-gradient(90deg, rgba(132, 152, 145, 0.1) 0%, transparent 52%);
}

body[data-theme="dark"] .live-activity-item[data-level="1"] .live-activity-icon::before {
  content: '🟢';
}

body[data-theme="dark"] .live-activity-level.level-1 {
  background: rgba(132, 152, 145, 0.14);
  color: var(--fc-accent);
}

body[data-theme="dark"] :is(
  .recent-activity-item[data-agent="rodrigo"] .recent-activity-agent,
  .live-activity-item[data-agent="rodrigo"] .live-activity-agent,
  .activity-log-agent,
  .schedule-date,
  .schedule-modal-time,
  .schedule-mini-time,
  .schedule-week-range,
  .week-number,
  .cycle-stat-value,
  .news-title-link:hover,
  .news-link-url,
  .news-link:hover,
  a,
  .inline-link
) {
  color: var(--fc-accent);
}

body[data-theme="dark"] :is(
  .recent-activity-item[data-agent="helios"] .recent-activity-agent,
  .live-activity-item[data-agent="helios"] .live-activity-agent,
  .legend-color.front-lever,
  .calendar-day.front-lever,
  .schedule-type.type-seminar,
  .schedule-modal-event.type-seminar,
  .schedule-mini-event.type-seminar,
  .workout-badge.pull,
  .day-type-badge.pull,
  .exercise-icon.pull
) {
  border-color: rgba(47, 111, 91, 0.34);
  border-left-color: var(--fc-highlight);
  background: color-mix(in srgb, var(--fc-highlight-wash) 92%, transparent);
  color: var(--fc-highlight-soft);
}

body[data-theme="dark"] :is(
  .calendar-day:hover,
  .calendar-day.selected,
  .calendar-day.today,
  .schedule-event.type-lecture,
  .schedule-modal-event.type-lecture,
  .schedule-mini-event.type-lecture,
  .schedule-event.today,
  .schedule-day-card.today,
  .schedule-event.current,
  .schedule-mini-event.current,
  .schedule-modal-event.current,
  .selected-workout,
  .nutrition-slot-card.active,
  .nutrition-period-day-card.active
) {
  border-color: rgba(132, 152, 145, 0.38);
  border-left-color: var(--fc-accent);
  background: color-mix(in srgb, var(--fc-accent-wash) 84%, transparent);
  box-shadow: 0 0 0 1px rgba(132, 152, 145, 0.12), 0 12px 24px rgba(45, 57, 53, 0.12);
}

body[data-theme="dark"] .calendar-day.today {
  border-width: 3px !important;
}

body[data-theme="dark"] .calendar-day.today .calendar-day-number {
  color: var(--fc-accent) !important;
}

body[data-theme="dark"] .calendar-day.today .calendar-day-today-badge,
body[data-theme="dark"] :is(.schedule-today-badge, .schedule-today-badge-inline) {
  background: var(--fc-accent);
  color: #17201d;
}

body[data-theme="dark"] :is(
  .status-badge.working,
  .recent-activity-item.status-working,
  .live-activity-item.status-working,
  .live-dot,
  .live-pulse-dot,
  .live-dot-pulse,
  .live-activity-dot,
  .legend-color.today
) {
  background: color-mix(in srgb, var(--fc-accent-wash) 92%, transparent);
  color: var(--fc-accent-soft);
  box-shadow: 0 0 0 1px rgba(132, 152, 145, 0.32), 0 0 14px rgba(132, 152, 145, 0.14);
}

body[data-theme="dark"] :is(
  .status-indicator.working,
  .status-indicator.status-working,
  .status-indicator-modern.active,
  .live-activity-badge::before
) {
  background: var(--fc-accent);
  box-shadow: 0 0 0 1px rgba(132, 152, 145, 0.32), 0 0 14px rgba(132, 152, 145, 0.14);
}

body[data-theme="dark"] :is(
  .status-indicator::after,
  .status-indicator.working::after,
  .status-indicator.status-working::after,
  .live-dot::after,
  .live-dot-pulse::after
) {
  background: radial-gradient(circle, rgba(132, 152, 145, 0.26) 0%, rgba(132, 152, 145, 0.1) 55%, rgba(132, 152, 145, 0) 100%);
}

body[data-theme="dark"] .quick-action-btn:hover {
  box-shadow: 0 16px 32px rgba(55, 30, 37, 0.2);
}

body[data-theme="dark"] .loading-skeleton {
  background: linear-gradient(90deg, rgba(22, 34, 28, 0.78), rgba(77, 139, 114, 0.18), rgba(22, 34, 28, 0.78));
  background-size: 200% 100%;
}

body[data-theme="dark"] #page-nutrition :is(.section-title-main, .health-check-title) {
  color: var(--fc-accent-soft);
}

body[data-theme="dark"] #page-nutrition :is(.nutrition-analysis-meta, .nutrition-selected-slot-hint, .nutrition-slot-macro, .nutrition-entry-meta, .nutrition-empty-slot, .nutrition-period-label, #nutritionAutoBurnHint, #nutritionFormula) {
  color: var(--fc-text-dark-muted) !important;
}

body[data-theme="dark"] #page-nutrition .nutrition-slot-card {
  border-color: rgba(132, 152, 145, 0.22);
  background:
    linear-gradient(180deg, rgba(21, 33, 28, 0.9) 0%, rgba(16, 24, 21, 0.96) 100%),
    radial-gradient(circle at top right, rgba(47, 111, 91, 0.08) 0%, rgba(47, 111, 91, 0) 62%);
  box-shadow: inset 0 0 0 1px rgba(132, 152, 145, 0.04);
}

body[data-theme="dark"] #page-nutrition .nutrition-slot-card:hover {
  border-color: rgba(47, 111, 91, 0.4);
  box-shadow: inset 0 0 0 1px rgba(132, 152, 145, 0.05), 0 16px 28px rgba(45, 57, 53, 0.12);
}

body[data-theme="dark"] #page-nutrition .nutrition-slot-card.active {
  border-color: rgba(47, 111, 91, 0.38);
  background:
    linear-gradient(180deg, rgba(28, 36, 31, 0.94) 0%, rgba(18, 24, 22, 0.98) 100%),
    radial-gradient(circle at top right, rgba(47, 111, 91, 0.11) 0%, rgba(47, 111, 91, 0) 58%);
  box-shadow: inset 0 0 0 1px rgba(132, 152, 145, 0.08), 0 18px 32px rgba(34, 44, 40, 0.14);
}

body[data-theme="dark"] #page-nutrition .nutrition-entry-item,
body[data-theme="dark"] #page-nutrition .nutrition-period-day-card {
  border-color: rgba(132, 152, 145, 0.22);
  background:
    linear-gradient(180deg, rgba(23, 35, 30, 0.92) 0%, rgba(17, 24, 22, 0.98) 100%),
    radial-gradient(circle at top right, rgba(47, 111, 91, 0.05) 0%, rgba(47, 111, 91, 0) 62%);
  box-shadow: inset 0 0 0 1px rgba(132, 152, 145, 0.04);
}

body[data-theme="dark"] #page-nutrition .nutrition-entry-item:hover,
body[data-theme="dark"] #page-nutrition .nutrition-period-day-card:hover {
  background:
    linear-gradient(180deg, rgba(26, 39, 33, 0.94) 0%, rgba(18, 25, 23, 0.98) 100%),
    radial-gradient(circle at top right, rgba(47, 111, 91, 0.08) 0%, rgba(47, 111, 91, 0) 60%);
  box-shadow: inset 0 0 0 1px rgba(132, 152, 145, 0.05), 0 14px 24px rgba(34, 44, 40, 0.12);
}

body[data-theme="dark"] #page-nutrition .nutrition-period-day-card.active {
  border-color: rgba(47, 111, 91, 0.34);
  background:
    linear-gradient(180deg, rgba(27, 37, 32, 0.95) 0%, rgba(18, 25, 22, 0.98) 100%),
    radial-gradient(circle at top right, rgba(47, 111, 91, 0.1) 0%, rgba(47, 111, 91, 0) 56%);
  box-shadow: inset 0 0 0 1px rgba(132, 152, 145, 0.08), 0 16px 28px rgba(36, 46, 42, 0.13);
}

body[data-theme="dark"] #page-nutrition .nutrition-entry-actions .health-check-badge,
body[data-theme="dark"] #page-nutrition .nutrition-period-day-card .health-check-badge {
  background:
    linear-gradient(180deg, rgba(28, 43, 35, 0.78) 0%, rgba(20, 29, 25, 0.9) 100%);
  border-color: rgba(132, 152, 145, 0.26);
  color: var(--fc-text-dark);
}

body[data-theme="dark"] #page-nutrition .nutrition-period-day-head strong,
body[data-theme="dark"] #page-nutrition .nutrition-period-day-kpis strong,
body[data-theme="dark"] #page-nutrition .nutrition-entry-title {
  color: var(--fc-text-dark);
}

body[data-theme="dark"] #page-nutrition .nutrition-slot-card.drag-target {
  border-color: rgba(132, 152, 145, 0.42);
  background:
    linear-gradient(180deg, rgba(25, 38, 31, 0.94) 0%, rgba(17, 25, 22, 0.98) 100%),
    radial-gradient(circle at top right, rgba(47, 111, 91, 0.12) 0%, rgba(47, 111, 91, 0) 64%);
  box-shadow: inset 0 0 0 1px rgba(132, 152, 145, 0.12), 0 0 0 4px rgba(132, 152, 145, 0.08);
}

body[data-theme="dark"] #page-nutrition .nutrition-empty-slot {
  border-color: rgba(132, 152, 145, 0.22);
  background:
    linear-gradient(180deg, rgba(24, 37, 31, 0.76) 0%, rgba(17, 24, 21, 0.84) 100%),
    radial-gradient(circle at top right, rgba(47, 111, 91, 0.05) 0%, rgba(47, 111, 91, 0) 60%);
}

body[data-theme="dark"] #page-nutrition .nutrition-slot-controls .health-check-badge {
  background: color-mix(in srgb, var(--fc-accent-wash) 92%, transparent);
  border-color: rgba(132, 152, 145, 0.24);
  color: var(--fc-accent-soft);
}

body[data-theme="dark"] #page-nutrition .nutrition-slot-inline-composer {
  border-color: rgba(132, 152, 145, 0.24);
  background:
    linear-gradient(180deg, rgba(25, 40, 32, 0.7) 0%, rgba(18, 27, 23, 0.82) 100%),
    radial-gradient(circle at top right, rgba(47, 111, 91, 0.06) 0%, rgba(47, 111, 91, 0) 58%);
  box-shadow: inset 0 0 0 1px rgba(132, 152, 145, 0.08);
}

body[data-theme="dark"] #page-nutrition :is(input, select, textarea) {
  color-scheme: dark;
  accent-color: var(--fc-accent-strong);
  background: linear-gradient(180deg, rgba(24, 39, 31, 0.92) 0%, rgba(18, 28, 23, 0.96) 100%) !important;
  border-color: rgba(132, 152, 145, 0.24) !important;
  color: var(--fc-text-dark) !important;
}

body[data-theme="dark"] #page-nutrition :is(input, select, textarea)::placeholder {
  color: var(--fc-text-dark-muted);
}

body[data-theme="dark"] #page-nutrition :is(input, select, textarea):focus {
  outline: none;
  border-color: rgba(132, 152, 145, 0.38) !important;
  box-shadow: 0 0 0 3px rgba(132, 152, 145, 0.14);
}

body[data-theme="dark"] #page-nutrition input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(84%) sepia(14%) saturate(429%) hue-rotate(93deg) brightness(93%) contrast(87%);
}

body[data-theme="dark"] #page-nutrition .health-check-badge {
  background: color-mix(in srgb, var(--fc-accent-wash) 92%, transparent);
  border-color: rgba(132, 152, 145, 0.22);
  color: var(--fc-accent-soft);
}

body[data-theme="dark"] #page-nutrition :is(.hero-action-btn, .nutrition-slot-add-btn, .nutrition-edit-btn, .nutrition-cancel-btn) {
  background: color-mix(in srgb, var(--fc-accent-wash) 92%, transparent);
  border-color: rgba(132, 152, 145, 0.28);
  color: var(--fc-accent-soft);
  box-shadow: none;
}

body[data-theme="dark"] #page-nutrition :is(.hero-action-btn:hover, .nutrition-slot-add-btn:hover, .nutrition-edit-btn:hover, .nutrition-cancel-btn:hover),
body[data-theme="dark"] #page-nutrition :is(.hero-action-btn:active, .nutrition-slot-add-btn:active, .nutrition-edit-btn:active, .nutrition-cancel-btn:active) {
  background: color-mix(in srgb, var(--fc-highlight-wash) 92%, transparent);
  border-color: rgba(47, 111, 91, 0.46);
  color: var(--fc-highlight-soft);
}

body[data-theme="dark"] #page-nutrition .nutrition-delete-btn {
  background: color-mix(in srgb, var(--fc-highlight-wash) 92%, transparent);
  border-color: rgba(47, 111, 91, 0.34);
  color: var(--fc-highlight-soft);
}

body[data-theme="dark"] #page-nutrition :is(.nutrition-entry-item:hover, .nutrition-period-day-card:hover, .nutrition-slot-card:hover) {
  border-color: rgba(47, 111, 91, 0.42);
}

body[data-theme="dark"] #page-nutrition .nutrition-summary-grid .cron-stat-card {
  border-color: rgba(132, 152, 145, 0.2);
  background:
    linear-gradient(180deg, rgba(24, 38, 31, 0.9) 0%, rgba(18, 27, 23, 0.96) 100%),
    radial-gradient(circle at top right, rgba(47, 111, 91, 0.08) 0%, rgba(47, 111, 91, 0) 58%);
  box-shadow: inset 0 0 0 1px rgba(132, 152, 145, 0.04);
}

body[data-theme="dark"] #page-nutrition .nutrition-summary-grid .cron-stat-card:hover {
  border-color: rgba(47, 111, 91, 0.38);
  box-shadow: inset 0 0 0 1px rgba(132, 152, 145, 0.06), 0 16px 28px rgba(45, 57, 53, 0.12);
}

body[data-theme="dark"] #page-nutrition .nutrition-summary-grid .cron-stat-value {
  color: var(--fc-accent-soft);
  text-shadow: none;
}

body[data-theme="dark"] #page-nutrition .nutrition-summary-grid .cron-stat-label {
  color: var(--fc-text-dark-muted);
}

body[data-theme="dark"] #page-nutrition :is(.nutrition-detail-card, .nutrition-trend-card) {
  border-color: rgba(132, 152, 145, 0.22);
  background:
    linear-gradient(180deg, rgba(21, 33, 28, 0.9) 0%, rgba(17, 25, 22, 0.96) 100%),
    radial-gradient(circle at top right, rgba(47, 111, 91, 0.07) 0%, rgba(47, 111, 91, 0) 62%);
  box-shadow: inset 0 0 0 1px rgba(132, 152, 145, 0.04);
}

body[data-theme="dark"] #page-nutrition :is(.nutrition-detail-card h4, .nutrition-trend-value, .nutrition-feedback-summary, .nutrition-detail-card strong) {
  color: var(--fc-text-dark);
}

body[data-theme="dark"] #page-nutrition :is(.nutrition-trend-label, .nutrition-trend-delta, .nutrition-macro-legend, .nutrition-food-chip.muted) {
  color: var(--fc-text-dark-muted);
}

body[data-theme="dark"] #page-nutrition #nutritionFeedback .health-check-item,
body[data-theme="dark"] #page-nutrition #nutritionEntriesList .health-check-item,
body[data-theme="dark"] #page-nutrition #nutritionFormula,
body[data-theme="dark"] #page-nutrition .health-check-loading {
  border-color: rgba(132, 152, 145, 0.22);
  background:
    linear-gradient(180deg, rgba(24, 37, 31, 0.82) 0%, rgba(17, 24, 21, 0.9) 100%),
    radial-gradient(circle at top right, rgba(47, 111, 91, 0.06) 0%, rgba(47, 111, 91, 0) 60%);
}

body[data-theme="dark"] #page-nutrition #nutritionFormula {
  border-style: solid;
}

body[data-theme="dark"] #page-nutrition .nutrition-food-chip {
  border-color: rgba(132, 152, 145, 0.24);
  background: linear-gradient(180deg, rgba(27, 42, 34, 0.72) 0%, rgba(20, 28, 24, 0.84) 100%);
  color: var(--fc-text-dark);
}

body[data-theme="dark"] #page-nutrition .nutrition-progress-track {
  background: rgba(37, 51, 45, 0.72);
}

body[data-theme="dark"] #page-nutrition .nutrition-progress-track span {
  background: linear-gradient(90deg, rgba(132, 152, 145, 0.86) 0%, rgba(160, 178, 170, 0.98) 100%);
}

body[data-theme="dark"] #page-nutrition .nutrition-macro-stack .protein {
  background: rgba(132, 152, 145, 0.95);
}

body[data-theme="dark"] #page-nutrition .nutrition-macro-stack .carbs {
  background: rgba(47, 111, 91, 0.76);
}

body[data-theme="dark"] #page-nutrition .nutrition-macro-stack .fat {
  background: rgba(180, 129, 67, 0.86);
}

body[data-theme="dark"] #page-schedule .schedule-container {
  gap: 1.7rem;
}

body[data-theme="dark"] #page-schedule .schedule-section {
  position: relative;
  padding: 1.15rem 1.2rem 1.2rem;
  border: 1px solid rgba(132, 152, 145, 0.18);
  border-left: 1px solid rgba(132, 152, 145, 0.22);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(22, 31, 28, 0.9) 0%, rgba(16, 23, 21, 0.96) 100%),
    radial-gradient(circle at top right, rgba(47, 111, 91, 0.06) 0%, rgba(47, 111, 91, 0) 58%);
  box-shadow: inset 0 0 0 1px rgba(132, 152, 145, 0.04), 0 16px 32px rgba(9, 14, 12, 0.18);
}

body[data-theme="dark"] #page-schedule :is(.schedule-today, .schedule-week) {
  border-left-color: rgba(132, 152, 145, 0.22);
}

body[data-theme="dark"] #page-schedule :is(.schedule-today, .schedule-week)::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  border-radius: 18px 0 0 18px;
  background: linear-gradient(180deg, rgba(132, 152, 145, 0.72) 0%, rgba(132, 152, 145, 0.26) 70%, rgba(47, 111, 91, 0.18) 100%);
}

body[data-theme="dark"] #page-schedule :is(.schedule-section-title, .section-title-main, .group-selector-label, .schedule-title, .schedule-modal-title, .schedule-day-name, .library-hours-status-title, .library-hours-row-day, .library-hours-row-time, .schedule-mini-title) {
  color: var(--fc-text-dark);
}

body[data-theme="dark"] #page-schedule :is(.schedule-day, .schedule-day-date, .schedule-details, .schedule-modal-info, .schedule-empty, .schedule-loading, .schedule-day-empty, .schedule-modal-empty, .schedule-last-update, #scheduleTodayDate, .library-hours-status-text, .schedule-scrape-status, .progressive-summary-copy),
body[data-theme="dark"] #page-schedule + footer {
  color: var(--fc-text-dark-muted) !important;
}

body[data-theme="dark"] #page-schedule :is(.schedule-time, .schedule-modal-time, .schedule-mini-time, .schedule-topic-label, .schedule-week-range) {
  color: var(--fc-accent-soft) !important;
}

body[data-theme="dark"] #page-schedule :is(.schedule-event, .schedule-modal-event, .schedule-day-card, .schedule-mini-event, .schedule-week-nav, .notification-toggle, .library-hours-status, .library-hours-row) {
  border-color: rgba(132, 152, 145, 0.18);
  background:
    linear-gradient(180deg, rgba(26, 36, 32, 0.82) 0%, rgba(17, 25, 22, 0.92) 100%),
    radial-gradient(circle at top right, rgba(47, 111, 91, 0.05) 0%, rgba(47, 111, 91, 0) 56%);
  box-shadow: inset 0 0 0 1px rgba(132, 152, 145, 0.04);
}

body[data-theme="dark"] #page-schedule :is(.schedule-event:hover, .schedule-modal-event:hover, .schedule-day-card:hover, .library-hours-row:hover) {
  border-color: rgba(47, 111, 91, 0.34);
  box-shadow: inset 0 0 0 1px rgba(132, 152, 145, 0.05), 0 16px 28px rgba(34, 22, 25, 0.16);
}

body[data-theme="dark"] #page-schedule :is(.schedule-event.type-exercise, .schedule-modal-event.type-exercise, .schedule-mini-event.type-exercise, .schedule-event.today, .schedule-day-card.today, .schedule-event.current, .schedule-mini-event.current, .schedule-modal-event.current) {
  border-color: rgba(132, 152, 145, 0.34);
  border-left-color: var(--fc-accent);
  background:
    linear-gradient(180deg, rgba(33, 47, 40, 0.88) 0%, rgba(20, 29, 25, 0.96) 100%),
    radial-gradient(circle at top right, rgba(47, 111, 91, 0.06) 0%, rgba(47, 111, 91, 0) 56%);
  box-shadow: 0 0 0 1px rgba(132, 152, 145, 0.1), 0 12px 24px rgba(45, 57, 53, 0.12);
}

body[data-theme="dark"] #page-schedule :is(.schedule-event.next, .schedule-mini-event.next, .schedule-modal-event.next, .schedule-week-nav-btn:hover, .schedule-week-nav-btn:focus-visible) {
  border-color: rgba(47, 111, 91, 0.42);
  background:
    linear-gradient(180deg, rgba(40, 29, 33, 0.88) 0%, rgba(24, 19, 21, 0.96) 100%),
    radial-gradient(circle at top right, rgba(47, 111, 91, 0.12) 0%, rgba(47, 111, 91, 0) 58%);
  box-shadow: inset 0 0 0 1px rgba(47, 111, 91, 0.12), 0 12px 26px rgba(22, 44, 37, 0.16);
}

body[data-theme="dark"] #page-schedule .schedule-event.next::before {
  background: rgba(47, 111, 91, 0.92);
  color: var(--fc-highlight-soft);
  box-shadow: 0 6px 16px rgba(41, 20, 26, 0.22);
}

body[data-theme="dark"] #page-schedule :is(.schedule-mini-event.type-seminar, .schedule-modal-event.type-seminar) {
  border-left-color: var(--fc-highlight);
}

body[data-theme="dark"] #page-schedule .schedule-type {
  border: 1px solid transparent;
}

body[data-theme="dark"] #page-schedule .schedule-type.type-lecture {
  background: rgba(96, 165, 250, 0.14);
  border-color: rgba(96, 165, 250, 0.24);
  color: #bfdbfe;
}

body[data-theme="dark"] #page-schedule .schedule-type.type-exercise {
  background: color-mix(in srgb, var(--fc-accent-wash) 92%, transparent);
  border-color: rgba(132, 152, 145, 0.22);
  color: var(--fc-accent-soft);
}

body[data-theme="dark"] #page-schedule .schedule-type.type-seminar {
  background: color-mix(in srgb, var(--fc-highlight-wash) 92%, transparent);
  border-color: rgba(47, 111, 91, 0.3);
  color: var(--fc-highlight-soft);
}

body[data-theme="dark"] #page-schedule .schedule-type.type-unknown {
  background: rgba(132, 152, 145, 0.12);
  border-color: rgba(132, 152, 145, 0.16);
  color: var(--fc-text-dark-muted);
}

body[data-theme="dark"] #page-schedule .schedule-topic-status-badge,
body[data-theme="dark"] #page-schedule .schedule-mini-badge.next,
body[data-theme="dark"] #page-schedule .notification-toggle-btn.permission,
body[data-theme="dark"] #page-schedule .notification-lead-time.long {
  background: rgba(47, 111, 91, 0.16);
  color: var(--fc-highlight-soft);
  border: 1px solid rgba(47, 111, 91, 0.28);
}

body[data-theme="dark"] #page-schedule .schedule-mini-badge.current,
body[data-theme="dark"] #page-schedule .notification-toggle-btn.enabled,
body[data-theme="dark"] #page-schedule .notification-lead-time.short,
body[data-theme="dark"] #page-schedule .library-hours-status.is-open .library-hours-status-badge {
  background: rgba(132, 152, 145, 0.18);
  color: var(--fc-accent-soft);
  border: 1px solid rgba(132, 152, 145, 0.28);
}

body[data-theme="dark"] #page-schedule .notification-toggle-btn.disabled {
  background: rgba(78, 91, 86, 0.26);
  color: var(--fc-text-dark-soft);
  border: 1px solid rgba(132, 152, 145, 0.18);
}

body[data-theme="dark"] #page-schedule :is(.calendar-nav-btn, .schedule-week-nav-btn) {
  background: rgba(132, 152, 145, 0.1);
  color: var(--fc-accent-soft);
  border-color: rgba(132, 152, 145, 0.22);
}

body[data-theme="dark"] #page-schedule :is(.calendar-nav-btn:hover, .calendar-nav-btn:focus-visible, .schedule-week-nav-btn:hover, .schedule-week-nav-btn:focus-visible) {
  background: rgba(47, 111, 91, 0.14);
  color: var(--fc-highlight-soft);
  border-color: rgba(47, 111, 91, 0.4);
}

body[data-theme="dark"] #page-schedule .schedule-day-header {
  border-bottom-color: rgba(132, 152, 145, 0.14);
}

body[data-theme="dark"] #page-schedule .schedule-inline-note.is-past {
  color: var(--fc-text-dark-muted);
  font-size: 0.8rem;
}

body[data-theme="dark"] #page-schedule .schedule-today-badge-inline.is-current {
  background: rgba(132, 152, 145, 0.18);
  color: var(--fc-accent-soft);
  border: 1px solid rgba(132, 152, 145, 0.28);
}

body[data-theme="dark"] #page-schedule .schedule-today-badge-inline.is-next {
  background: rgba(47, 111, 91, 0.16);
  color: var(--fc-highlight-soft);
  border: 1px solid rgba(47, 111, 91, 0.28);
}

body[data-theme="light"] #page-schedule .schedule-today-badge-inline.is-next {
  background: rgba(47, 111, 91, 0.14);
  color: var(--fc-highlight);
  border: 1px solid rgba(47, 111, 91, 0.22);
}

body[data-theme="light"] #page-schedule .schedule-inline-note.is-past {
  color: var(--fc-text-light-muted);
}

body[data-theme="dark"] #page-schedule :is(.library-hours-status.is-open, .library-hours-row.is-currently-open, .library-hours-row.is-today) {
  border-color: rgba(132, 152, 145, 0.28);
  background:
    linear-gradient(180deg, rgba(29, 43, 37, 0.88) 0%, rgba(17, 24, 21, 0.96) 100%),
    radial-gradient(circle at top right, rgba(132, 152, 145, 0.08) 0%, rgba(132, 152, 145, 0) 60%);
}

body[data-theme="dark"] #page-schedule .library-hours-status.is-warning,
body[data-theme="dark"] #page-schedule .library-hours-status.is-closed {
  border-color: rgba(47, 111, 91, 0.28);
  background:
    linear-gradient(180deg, rgba(38, 28, 31, 0.88) 0%, rgba(19, 18, 19, 0.96) 100%),
    radial-gradient(circle at top right, rgba(47, 111, 91, 0.1) 0%, rgba(47, 111, 91, 0) 60%);
}

/* Production near-black rollout across the remaining tabs and shared surfaces */
body[data-theme="dark"] {
  --fc-bg-dark: #07090b;
  --fc-bg-dark-alt: #0b0e11;
  --fc-surface-dark: linear-gradient(180deg, rgba(18, 20, 23, 0.96) 0%, rgba(10, 12, 14, 0.99) 100%);
  --fc-surface-dark-strong: linear-gradient(180deg, rgba(22, 25, 28, 0.97) 0%, rgba(13, 15, 18, 0.995) 100%);
  --fc-surface-dark-soft: linear-gradient(180deg, rgba(25, 28, 31, 0.94) 0%, rgba(15, 17, 20, 0.985) 100%);
  --fc-border-dark: rgba(198, 206, 202, 0.13);
  --fc-border-dark-strong: rgba(198, 206, 202, 0.22);
  --fc-text-dark: #eef2ef;
  --fc-text-dark-soft: #d4dbd7;
  --fc-text-dark-muted: #98a39f;
  --fc-accent: #b9c4bf;
  --fc-accent-strong: #909c97;
  --fc-accent-soft: #edf2ef;
  --fc-accent-wash: rgba(185, 196, 191, 0.1);
  --fc-accent-glow: rgba(185, 196, 191, 0.12);
  --fc-highlight: #9d7a82;
  --fc-highlight-soft: #e8dade;
  --fc-highlight-wash: rgba(157, 122, 130, 0.11);
  --fc-shadow-dark: 0 20px 44px rgba(0, 0, 0, 0.34);
  --home-shell-surface: linear-gradient(180deg, rgba(18, 20, 23, 0.97) 0%, rgba(10, 12, 14, 0.995) 100%);
  --home-shell-surface-soft: linear-gradient(180deg, rgba(23, 26, 29, 0.94) 0%, rgba(14, 16, 19, 0.985) 100%);
  --home-shell-border: rgba(198, 206, 202, 0.12);
  --home-shell-border-strong: rgba(198, 206, 202, 0.22);
  --home-shell-shadow: 0 22px 48px rgba(0, 0, 0, 0.42);
  --home-shell-radius-lg: 12px;
  --home-shell-radius-md: 10px;
  --home-shell-radius-sm: 8px;
}

body[data-theme="dark"] {
  background:
    radial-gradient(circle at 14% 14%, rgba(157, 122, 130, 0.055) 0%, transparent 28%),
    radial-gradient(circle at 84% 8%, rgba(185, 196, 191, 0.04) 0%, transparent 26%),
    linear-gradient(180deg, #07090b 0%, #0a0c0f 40%, #0d1013 100%);
}

body[data-theme="dark"] :is(
  .card,
  .workout-card,
  .health-section,
  .cron-stat-card,
  .news-card,
  .downloads-loading,
  .downloads-empty,
  .downloads-error,
  .download-card,
  .download-item,
  .focus-cockpit-card,
  .focus-metric,
  .schedule-section,
  .schedule-event,
  .schedule-day-card,
  .schedule-mini-event,
  .schedule-modal-event,
  .schedule-week-nav,
  .notification-toggle,
  .library-hours-status,
  .library-hours-row,
  .calisthenics-section,
  .exercise-item,
  .day-card,
  .week-header,
  .cycle-info,
  .nutrition-slot-card,
  .nutrition-entry-item,
  .nutrition-period-day-card,
  .nutrition-detail-card,
  .nutrition-trend-card,
  .nutrition-inline-composer,
  .nutrition-slot-inline-composer,
  .nutrition-profile-disclosure,
  .nutrition-busy-state,
  .nutrition-settings-modal,
  .study-card,
  .life-card,
  .task-context-card,
  .history-item,
  .current-status,
  .agent-stat-item,
  .live-activity-section,
  .model-select,
  .modal-content,
  .admin-modal-content
) {
  background: var(--fc-surface-dark);
  border-color: var(--fc-border-dark);
  border-radius: 12px;
  box-shadow: var(--fc-shadow-dark);
}

body[data-theme="dark"] :is(
  .news-card,
  .downloads-loading,
  .downloads-empty,
  .downloads-error,
  .download-card,
  .download-item,
  .focus-cockpit-card,
  .focus-metric,
  .health-section,
  .cron-stat-card,
  .nutrition-slot-card,
  .nutrition-entry-item,
  .nutrition-period-day-card,
  .nutrition-detail-card,
  .nutrition-trend-card,
  .nutrition-inline-composer,
  .nutrition-slot-inline-composer,
  .nutrition-profile-disclosure,
  .nutrition-busy-state,
  .nutrition-settings-modal,
  .exercise-item,
  .day-card,
  .week-header,
  .cycle-info,
  .task-context-card,
  .history-item,
  .current-status,
  .agent-stat-item,
  .live-activity-section,
  .model-select
) {
  background: var(--fc-surface-dark-soft);
}

body[data-theme="dark"] :is(
  .news-card:hover,
  .download-card:hover,
  .download-item:hover,
  .focus-cockpit-card:hover,
  .health-section:hover,
  .cron-stat-card:hover,
  .exercise-item:hover,
  .day-card:hover,
  .week-header:hover,
  .nutrition-slot-card:hover,
  .nutrition-entry-item:hover,
  .nutrition-period-day-card:hover
) {
  border-color: rgba(157, 122, 130, 0.3);
  box-shadow: 0 22px 40px rgba(0, 0, 0, 0.3);
}

body[data-theme="dark"] :is(
  #page-news .dashboard-header,
  #page-schedule .dashboard-header,
  #page-study-overview .dashboard-header,
  #page-downloads .dashboard-header,
  #page-focus .dashboard-header,
  #page-nutrition .dashboard-header,
  #page-calisthenics .dashboard-header,
  #page-study .dashboard-header,
  #page-organization .dashboard-header,
  #page-bachata .dashboard-header,
  #page-health .dashboard-header,
  #page-cron .dashboard-header
) {
  background: var(--home-shell-surface);
  border: 1px solid var(--home-shell-border);
  border-radius: var(--home-shell-radius-lg);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.34);
}

body[data-theme="dark"] :is(
  #page-news .news-container,
  #page-downloads .downloads-container,
  #page-focus .focus-cockpit-grid,
  #page-calisthenics .calisthenics-container,
  #page-health .health-grid,
  #page-cron .cron-grid,
  #page-study-overview .study-overview-grid,
  #page-organization .life-page-grid,
  #page-bachata .life-page-grid,
  #page-study .life-page-grid
) {
  gap: 1rem;
}

body[data-theme="dark"] #page-schedule .schedule-section {
  padding: 1.1rem 1.15rem 1.15rem;
  border-radius: 12px;
  border-left-width: 1px;
  background: var(--fc-surface-dark);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02), 0 18px 34px rgba(0, 0, 0, 0.26);
}

body[data-theme="dark"] #page-schedule :is(.schedule-today, .schedule-week)::before {
  width: 2px;
  border-radius: 12px 0 0 12px;
  background: linear-gradient(180deg, rgba(185, 196, 191, 0.46) 0%, rgba(157, 122, 130, 0.18) 100%);
}

body[data-theme="dark"] #page-schedule :is(.schedule-event, .schedule-modal-event, .schedule-day-card, .schedule-mini-event, .schedule-week-nav, .notification-toggle, .library-hours-status, .library-hours-row) {
  background: var(--fc-surface-dark-soft);
  border-color: rgba(198, 206, 202, 0.14);
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

body[data-theme="dark"] #page-focus :is(.focus-btn, .focus-priority-input, .focus-settings-row input, .focus-check-item) {
  background: var(--fc-surface-dark-soft);
  border-color: rgba(198, 206, 202, 0.14);
  border-radius: 10px;
  box-shadow: none;
}

body[data-theme="dark"] #page-focus .focus-btn.primary,
body[data-theme="dark"] #page-focus .focus-preset-btn.active {
  background: rgba(185, 196, 191, 0.12);
  border-color: rgba(198, 206, 202, 0.22);
  color: #eef2ef;
}

body[data-theme="dark"] #page-news .news-card,
body[data-theme="dark"] #page-downloads :is(.downloads-loading, .downloads-empty, .downloads-error, .download-card, .download-item) {
  background: var(--fc-surface-dark-soft);
  border-color: rgba(198, 206, 202, 0.14);
  border-radius: 10px;
}

body[data-theme="dark"] #page-nutrition .health-section {
  background: var(--fc-surface-dark);
  border-color: rgba(198, 206, 202, 0.14);
  border-radius: 12px;
}

body[data-theme="dark"] #page-nutrition :is(.nutrition-slot-card, .nutrition-entry-item, .nutrition-period-day-card, .nutrition-detail-card, .nutrition-trend-card, .nutrition-inline-composer, .nutrition-slot-inline-composer, .nutrition-profile-disclosure, .nutrition-busy-state, .nutrition-settings-modal) {
  background: var(--fc-surface-dark-soft);
  border-color: rgba(198, 206, 202, 0.14);
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

body[data-theme="dark"] #page-nutrition :is(.nutrition-slot-card.active, .nutrition-period-day-card.active) {
  background: linear-gradient(180deg, rgba(40, 31, 34, 0.92) 0%, rgba(21, 17, 19, 0.98) 100%);
  border-color: rgba(157, 122, 130, 0.34);
  box-shadow: inset 0 0 0 1px rgba(157, 122, 130, 0.12);
}

body[data-theme="dark"] #page-nutrition :is(input, select, textarea) {
  background: rgba(10, 12, 14, 0.92);
  border-color: rgba(198, 206, 202, 0.14);
  border-radius: 9px;
  color: var(--fc-text-dark);
}

body[data-theme="dark"] #page-calisthenics .calisthenics-section,
body[data-theme="dark"] #page-calisthenics :is(.exercise-item, .day-card, .calendar-day, .calendar-week-day, .week-header, .cycle-info) {
  background: var(--fc-surface-dark-soft);
  border-color: rgba(198, 206, 202, 0.14);
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

body[data-theme="dark"] #page-calisthenics :is(.today-workout, .selected-workout) {
  background: var(--fc-surface-dark);
  border-color: rgba(198, 206, 202, 0.18);
}

body[data-theme="dark"] :is(
  #page-study-overview .study-card,
  #page-study .life-card,
  #page-organization .life-card,
  #page-bachata .life-card,
  #page-health .health-section,
  #page-cron .health-section,
  #page-cron .cron-stat-card
) {
  background: var(--fc-surface-dark-soft);
  border-color: rgba(198, 206, 202, 0.14);
  border-radius: 10px;
}

body[data-theme="dark"] :is(.modal-content, .admin-modal-content) {
  background: var(--home-shell-surface);
  border-color: var(--home-shell-border);
  border-radius: 12px;
}

body[data-theme="dark"] :is(.modal-header, .nutrition-settings-modal-header) {
  background: linear-gradient(180deg, rgba(25, 28, 31, 0.9) 0%, rgba(15, 17, 20, 0.72) 100%);
  border-color: var(--home-shell-border);
}

body[data-theme="dark"] :is(.downloads-retry-btn, .news-retry-btn, .nutrition-settings-close-btn, .close-btn, .mobile-menu-close) {
  border-radius: 8px;
}

/* Light theme rebuild: translate the refined dark shell into a true light counterpart */
body[data-theme="light"] {
  --fc-bg-light: #f6f7f5;
  --fc-bg-light-alt: #edf1ee;
  --fc-surface-light: rgba(255, 255, 255, 0.9);
  --fc-surface-light-strong: rgba(255, 255, 255, 0.98);
  --fc-surface-light-soft: #f3f6f4;
  --fc-border-light: rgba(82, 100, 93, 0.12);
  --fc-border-light-strong: rgba(82, 100, 93, 0.2);
  --fc-text-light: #1f2c27;
  --fc-text-light-soft: #40524b;
  --fc-text-light-muted: #6d7d76;
  --fc-shadow-light: 0 14px 28px rgba(25, 38, 33, 0.06);

  --light-shell-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 249, 247, 1) 100%);
  --light-shell-surface-soft: linear-gradient(180deg, rgba(250, 251, 250, 0.97) 0%, rgba(242, 245, 243, 1) 100%);
  --light-shell-surface-muted: rgba(252, 252, 252, 0.94);
  --light-shell-border: rgba(82, 100, 93, 0.12);
  --light-shell-border-strong: rgba(82, 100, 93, 0.2);
  --light-shell-shadow: 0 12px 26px rgba(22, 34, 29, 0.06);
  --light-shell-shadow-hover: 0 18px 36px rgba(22, 34, 29, 0.08);
  --light-shell-inset: inset 0 1px 0 rgba(255, 255, 255, 0.82);

  background:
    radial-gradient(circle at 16% 14%, rgba(47, 111, 91, 0.025) 0%, transparent 32%),
    radial-gradient(circle at 84% 0%, rgba(93, 111, 104, 0.025) 0%, transparent 24%),
    linear-gradient(145deg, #f8f9f7 0%, var(--fc-bg-light) 34%, var(--fc-bg-light-alt) 70%, #eef2ef 100%);
}

body[data-theme="light"] .nav-container,
body[data-theme="light"] .nav-menu-mobile {
  background: var(--light-shell-surface);
  border-color: var(--light-shell-border);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.62);
}

body[data-theme="light"] .nav-brand,
body[data-theme="light"] .nav-brand-label {
  color: var(--fc-text-light);
}

body[data-theme="light"] .header-title {
  background: linear-gradient(90deg, #43574f 0%, #698077 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

body[data-theme="light"] .nav-brand-icon,
body[data-theme="light"] .nav-brand-reopen-icon {
  color: var(--fc-text-light-soft);
}

body[data-theme="light"] .nav-container .nav-tab,
body[data-theme="light"] .nav-menu-mobile .nav-tab {
  color: #5d6f68;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

body[data-theme="light"] .nav-container .nav-tab:hover,
body[data-theme="light"] .nav-container .nav-tab:focus-visible,
body[data-theme="light"] .nav-menu-mobile .nav-tab:hover,
body[data-theme="light"] .nav-menu-mobile .nav-tab:focus-visible {
  color: var(--fc-text-light);
  background: rgba(93, 111, 104, 0.08);
  border-color: rgba(93, 111, 104, 0.14);
  box-shadow: none;
}

body[data-theme="light"] .nav-container .nav-tab.active,
body[data-theme="light"] .nav-menu-mobile .nav-tab.active,
body[data-theme="light"] .lang-btn.active,
body[data-theme="light"] .theme-btn.active {
  color: var(--fc-text-light);
  background: linear-gradient(180deg, rgba(241, 246, 242, 0.99) 0%, rgba(223, 231, 226, 0.99) 100%);
  border-color: var(--light-shell-border-strong);
  box-shadow: inset 3px 0 0 rgba(82, 100, 93, 0.34), var(--light-shell-inset), 0 10px 22px rgba(22, 34, 29, 0.08);
  font-weight: 700;
}

body[data-theme="light"] .settings-container,
body[data-theme="light"] .mobile-menu-header,
body[data-theme="light"] .nav-menu-mobile .settings-divider {
  border-color: var(--light-shell-border);
}

body[data-theme="light"] .nav-container .settings-container {
  background: transparent;
  box-shadow: none;
}

body[data-theme="light"] :is(.sidebar-collapse-btn, .settings-btn, .settings-dropdown, .mobile-menu-close, .lang-btn, .theme-btn) {
  background: var(--light-shell-surface-soft);
  border-color: var(--light-shell-border);
  color: var(--fc-text-light-soft);
  box-shadow: var(--light-shell-inset), 0 10px 22px rgba(22, 34, 29, 0.07);
}

body[data-theme="light"] .settings-btn-icon,
body[data-theme="light"] .settings-user-avatar,
body[data-theme="light"] .mobile-menu-close {
  background: rgba(93, 111, 104, 0.08);
  color: var(--fc-text-light-soft);
}

body[data-theme="light"] :is(
  .dashboard-header,
  .card,
  .agent-card,
  .agent-card-modern,
  .status-card,
  .hierarchy-level,
  .life-card,
  .focus-card,
  .focus-cockpit-card,
  .workout-card,
  .calisthenics-section,
  .study-card,
  .news-card,
  .schedule-card,
  .health-section,
  .cron-stat-card,
  .quick-action-btn,
  .downloads-loading,
  .downloads-empty,
  .downloads-error,
  .download-card,
  .download-item,
  .modal-content,
  .admin-modal-content,
  .login-card
) {
  background: var(--light-shell-surface);
  border-color: var(--light-shell-border);
  box-shadow: var(--light-shell-inset), var(--light-shell-shadow);
  border-radius: 12px;
}

body[data-theme="light"] :is(
  .task-container,
  .task-container-modern,
  #jokeDisplay,
  .recent-activities-count,
  .recent-activity-item,
  .recent-activities-empty,
  .history-item,
  .activity-log,
  .activity-item,
  .current-status,
  .day-card,
  .exercise-item,
  .week-header,
  .cycle-info,
  .task-details-content,
  .library-hours-row,
  .calendar-day,
  .calendar-day.today,
  .calendar-day.current-workout,
  .focus-metric,
  .focus-check-item,
  .focus-settings-row input,
  .focus-priority-input,
  .focus-btn,
  .group-selector-select,
  .model-select,
  .setting-input,
  .calendar-nav-btn,
  .setting-btn,
  .nutrition-inline-composer,
  .nutrition-slot-card,
  .nutrition-entry-item,
  .nutrition-period-day-card,
  .nutrition-detail-card,
  .nutrition-trend-card,
  .nutrition-slot-inline-composer,
  .nutrition-profile-disclosure,
  .nutrition-busy-state,
  .nutrition-settings-modal,
  .schedule-event,
  .schedule-day-card,
  .schedule-mini-event,
  .schedule-modal-event,
  .library-hours-status-badge
) {
  background: linear-gradient(180deg, rgba(246, 249, 247, 0.96) 0%, rgba(233, 239, 235, 0.99) 100%);
  border-color: rgba(82, 100, 93, 0.12);
  box-shadow: var(--light-shell-inset);
  border-radius: 10px;
}

body[data-theme="light"] .dashboard-header {
  border-color: var(--light-shell-border-strong);
  box-shadow: var(--light-shell-inset), 0 20px 40px rgba(22, 34, 29, 0.1);
}

body[data-theme="light"] :is(.card:hover, .agent-card:hover, .agent-card-modern:hover, .status-card:hover, .workout-card:hover, .quick-action-btn:hover, .calendar-day:hover, .news-card:hover, .study-card:hover, .download-card:hover, .download-item:hover, .day-card:hover, .exercise-item:hover, .week-header:hover) {
  border-color: rgba(47, 111, 91, 0.34);
  box-shadow: var(--light-shell-inset), var(--light-shell-shadow-hover);
  transform: translateY(-2px);
}

body[data-theme="light"] #page-home .task-container-modern {
  margin-top: 0.95rem;
}

body[data-theme="light"] #page-home .recent-activities-count {
  color: var(--fc-text-light-soft);
  border-color: var(--light-shell-border-strong);
}

body[data-theme="light"] #page-home .recent-activity-item {
  border-left-color: rgba(93, 111, 104, 0.58);
}

body[data-theme="light"] #page-home .recent-activity-item:hover {
  background: linear-gradient(180deg, rgba(249, 250, 249, 0.98) 0%, rgba(238, 242, 239, 0.99) 100%);
  border-color: var(--light-shell-border-strong);
}

body[data-theme="light"] #page-home .recent-activity-item.status-working {
  background: linear-gradient(180deg, rgba(246, 239, 225, 0.96) 0%, rgba(239, 230, 210, 0.99) 100%);
  border-left-color: rgba(170, 134, 67, 0.82);
}

body[data-theme="light"] #page-home .recent-activity-item.status-success {
  background: linear-gradient(180deg, rgba(233, 243, 236, 0.96) 0%, rgba(223, 236, 228, 0.99) 100%);
  border-left-color: rgba(99, 141, 114, 0.82);
}

body[data-theme="light"] #page-home .recent-activity-item.status-error {
  background: linear-gradient(180deg, rgba(246, 236, 238, 0.96) 0%, rgba(239, 226, 229, 0.99) 100%);
  border-left-color: rgba(157, 101, 111, 0.82);
}

body[data-theme="light"] #page-home .recent-activity-item.status-info {
  background: linear-gradient(180deg, rgba(238, 244, 241, 0.96) 0%, rgba(228, 236, 232, 0.99) 100%);
  border-left-color: rgba(93, 111, 104, 0.74);
}

body[data-theme="light"] :is(.modal-header, .nutrition-settings-modal-header, .agent-stats-section, .model-section) {
  background: linear-gradient(180deg, rgba(249, 251, 249, 0.96) 0%, rgba(240, 244, 241, 0.98) 100%);
  border-color: var(--light-shell-border);
}

body[data-theme="light"] :is(.modal-icon, .current-status, .history-item, .task-context-card, .task-progress-entry, .delegation-flow, .agent-stat-item, .live-activity-section) {
  background: var(--light-shell-surface-soft);
  border-color: rgba(82, 100, 93, 0.12);
  box-shadow: var(--light-shell-inset);
}

body[data-theme="light"] :is(.hero-action-btn, .primary-cta, .page-primary-action, .quick-jump-btn, .back-to-top-btn, .focus-btn.primary, .focus-preset-btn.active, .coordination-indicator, .model-badge-card, .live-badge, .live-timer-container, .login-submit, .admin-btn-primary, .admin-sidebar-btn.active) {
  background: linear-gradient(180deg, rgba(239, 245, 241, 0.98) 0%, rgba(223, 231, 226, 0.99) 100%);
  border-color: var(--light-shell-border-strong);
  color: var(--fc-accent-strong);
  box-shadow: var(--light-shell-inset), 0 10px 22px rgba(22, 34, 29, 0.08);
}

body[data-theme="light"] :is(.secondary-cta, .calendar-nav-btn, .setting-btn, #jokeBtn, .focus-btn, .focus-preset-btn, .logout-btn, .settings-link-btn, .password-toggle, .admin-btn-secondary, .admin-modal-close) {
  background: var(--light-shell-surface-soft);
  border-color: var(--light-shell-border);
  color: var(--fc-text-light-soft);
  box-shadow: var(--light-shell-inset), 0 8px 18px rgba(22, 34, 29, 0.06);
}

body[data-theme="light"] :is(.hero-action-btn:hover, .primary-cta:hover, .secondary-cta:hover, .page-primary-action:hover, .calendar-nav-btn:hover, .quick-jump-btn:hover, .back-to-top-btn:hover, .setting-btn:hover, #jokeBtn:hover, .focus-btn:hover, .focus-preset-btn:hover, .login-submit:hover, .admin-btn:hover, .logout-btn:hover, .settings-link-btn:hover, .password-toggle:hover, .admin-modal-close:hover, .sidebar-collapse-btn:hover, .settings-btn:hover, .mobile-menu-close:hover, .lang-btn:hover, .theme-btn:hover) {
  background: linear-gradient(180deg, rgba(248, 242, 243, 0.98) 0%, rgba(239, 231, 234, 0.99) 100%);
  border-color: rgba(47, 111, 91, 0.34);
  color: var(--fc-highlight);
  box-shadow: var(--light-shell-inset), 0 12px 24px rgba(17, 61, 49, 0.12);
}

body[data-theme="light"] :is(.login-input, .setting-input, .focus-settings-row input, .focus-priority-input, .group-selector-select, .model-select, .admin-input, .admin-select, textarea) {
  background: rgba(255, 255, 255, 0.88);
  border-color: var(--light-shell-border);
  color: var(--fc-text-light);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

body[data-theme="light"] :is(.login-input::placeholder, .setting-input::placeholder, .focus-settings-row input::placeholder, .focus-priority-input::placeholder, .admin-input::placeholder, textarea::placeholder) {
  color: #7f8d87;
}

body[data-theme="light"] .login-submit:disabled {
  background: linear-gradient(180deg, rgba(246, 248, 246, 0.98) 0%, rgba(232, 237, 233, 0.98) 100%);
  border-color: rgba(107, 125, 118, 0.18);
  color: #86918d;
  box-shadow: none;
  opacity: 1;
}

body[data-theme="light"] .status-badge.working {
  background: rgba(191, 129, 67, 0.14);
  border: 1px solid rgba(191, 129, 67, 0.22);
  color: #8b6126;
}

body[data-theme="light"] .status-badge.idle {
  background: rgba(93, 111, 104, 0.08);
  border: 1px solid rgba(93, 111, 104, 0.14);
  color: #667770;
}

/* Calisthenics light theme: align page accents with the shared sage/bordeaux site palette */
body[data-theme="light"] #page-calisthenics {
  --cal-light-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(247, 250, 248, 1) 100%);
  --cal-light-surface-strong: linear-gradient(180deg, rgba(252, 253, 252, 0.99) 0%, rgba(239, 244, 241, 1) 100%);
  --cal-light-surface-soft: linear-gradient(180deg, rgba(244, 247, 245, 0.98) 0%, rgba(234, 239, 236, 0.99) 100%);
  --cal-light-border: rgba(93, 111, 104, 0.16);
  --cal-light-border-strong: rgba(93, 111, 104, 0.28);
  --cal-light-accent: #71857d;
  --cal-light-accent-strong: #52645d;
  --cal-light-accent-soft: rgba(113, 133, 125, 0.16);
  --cal-light-highlight: #2f6f5b;
  --cal-light-highlight-soft: rgba(47, 111, 91, 0.12);
  --cal-light-highlight-border: rgba(47, 111, 91, 0.24);
  --cal-light-warm: #bf8143;
  --cal-light-warm-soft: rgba(191, 129, 67, 0.14);
  --cal-light-rest: #87938d;
  --cal-light-text: #1f2c27;
  --cal-light-muted: #52645d;
  --cal-light-subtle: #6d7d76;
  --cal-light-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 12px 28px rgba(22, 34, 29, 0.07);
}

body[data-theme="light"] #page-calisthenics :is(.calisthenics-section, .progressive-section) {
  background: var(--cal-light-surface);
  border-color: var(--cal-light-border);
  box-shadow: var(--cal-light-shadow);
}

body[data-theme="light"] #page-calisthenics :is(.exercise-item, .day-card, .calendar-day, .calendar-week-day, .week-header, .cycle-info) {
  background: var(--cal-light-surface-soft);
  border-color: rgba(93, 111, 104, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body[data-theme="light"] #page-calisthenics :is(.today-workout, .selected-workout) {
  background: var(--cal-light-surface-strong);
  border-color: var(--cal-light-border-strong);
}

body[data-theme="light"] #page-calisthenics .today-workout {
  border-left-color: var(--cal-light-accent);
}

body[data-theme="light"] #page-calisthenics .today-workout.rest-day {
  border-left-color: var(--cal-light-warm);
}

body[data-theme="light"] #page-calisthenics .selected-workout {
  border-left-color: var(--cal-light-highlight) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84), 0 16px 34px rgba(26, 58, 48, 0.08);
}

body[data-theme="light"] #page-calisthenics :is(.section-title-main, .workout-title, .calendar-current-month, .calendar-current-week, .week-number, .day-name, .calendar-week-day-name, .calendar-week-number) {
  color: var(--cal-light-accent-strong);
}

body[data-theme="light"] #page-calisthenics :is(.exercise-name, .calendar-day-number, .day-exercise-name) {
  color: var(--cal-light-text);
}

body[data-theme="light"] #page-calisthenics :is(.workout-type, .workout-description, .legend-item, .day-exercises, .exercise-muscles, .calendar-day-workout, .calendar-weekday, .calendar-week-day-date, .calendar-week-day-workout, .week-expand-icon, .cycle-stat-label, .full-plan-subtitle, .progressive-summary-copy, #todayDate) {
  color: var(--cal-light-subtle) !important;
}

body[data-theme="light"] #page-calisthenics .progressive-section > summary::after {
  color: var(--cal-light-accent-strong);
}

body[data-theme="light"] #page-calisthenics .workout-badge.pull {
  background: var(--cal-light-accent-soft);
  color: var(--cal-light-accent-strong);
  border-color: rgba(113, 133, 125, 0.24);
}

body[data-theme="light"] #page-calisthenics :is(.workout-badge.push, .day-type-badge.push, .calendar-week-day-type.push) {
  background: var(--cal-light-highlight-soft);
  color: var(--cal-light-highlight);
  border-color: var(--cal-light-highlight-border);
}

body[data-theme="light"] #page-calisthenics :is(.workout-badge.pull, .day-type-badge.pull, .calendar-week-day-type.pull) {
  background: var(--cal-light-accent-soft);
  color: var(--cal-light-accent-strong);
  border-color: rgba(113, 133, 125, 0.24);
}

body[data-theme="light"] #page-calisthenics :is(.workout-badge.rest, .day-type-badge.rest, .calendar-week-day-type.rest) {
  background: rgba(135, 147, 141, 0.14);
  color: #667770;
  border-color: rgba(135, 147, 141, 0.22);
}

body[data-theme="light"] #page-calisthenics :is(.workout-badge.deload, .week-type.deload, .calendar-week-number.deload) {
  background: var(--cal-light-warm-soft);
  color: #8b6126;
  border-color: rgba(191, 129, 67, 0.24);
}

body[data-theme="light"] #page-calisthenics .exercise-icon {
  background: rgba(93, 111, 104, 0.08);
}

body[data-theme="light"] #page-calisthenics .exercise-icon.pull {
  background: rgba(113, 133, 125, 0.14);
}

body[data-theme="light"] #page-calisthenics .exercise-icon.push {
  background: rgba(47, 111, 91, 0.12);
}

body[data-theme="light"] #page-calisthenics .exercise-icon.rest {
  background: rgba(135, 147, 141, 0.12);
}

body[data-theme="light"] #page-calisthenics :is(.exercise-sets, .day-exercise-sets, .cycle-stat-value) {
  color: var(--cal-light-accent-strong);
  background: rgba(113, 133, 125, 0.14);
}

body[data-theme="light"] #page-calisthenics #selectedWorkoutSection .calendar-nav-btn {
  background: rgba(47, 111, 91, 0.08) !important;
  border-color: rgba(47, 111, 91, 0.18) !important;
  color: var(--cal-light-highlight) !important;
  box-shadow: none;
}

body[data-theme="light"] #page-calisthenics #selectedWorkoutSection .calendar-nav-btn:hover {
  background: rgba(47, 111, 91, 0.14) !important;
  border-color: rgba(47, 111, 91, 0.28) !important;
}

body[data-theme="light"] #page-calisthenics :is(.calendar-day:hover, .calendar-week-day:active, .week-header:hover) {
  background: linear-gradient(180deg, rgba(248, 242, 243, 0.98) 0%, rgba(239, 231, 234, 0.99) 100%);
  border-color: var(--cal-light-highlight-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84), 0 12px 24px rgba(26, 58, 48, 0.08);
}

body[data-theme="light"] #page-calisthenics .calendar-day.selected {
  background: rgba(47, 111, 91, 0.12);
  border-color: rgba(47, 111, 91, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84), 0 0 0 1px rgba(47, 111, 91, 0.1), 0 12px 24px rgba(26, 58, 48, 0.08);
}

body[data-theme="light"] #page-calisthenics :is(.calendar-day.today, .calendar-week-day.today) {
  background: rgba(113, 133, 125, 0.12);
  border: 3px solid var(--cal-light-accent) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84), 0 0 0 1px rgba(113, 133, 125, 0.12), 0 12px 24px rgba(60, 98, 80, 0.12);
}

body[data-theme="light"] #page-calisthenics :is(.calendar-day.today .calendar-day-number, .calendar-week-day.today .calendar-week-day-name) {
  color: var(--cal-light-accent-strong) !important;
}

body[data-theme="light"] #page-calisthenics :is(.calendar-day.today .calendar-day-today-badge, .calendar-week-day.today .calendar-week-day-today-badge) {
  background: var(--cal-light-accent-strong);
  color: #f8fafc;
}

body[data-theme="light"] #page-calisthenics :is(.calendar-day.current-workout, .calendar-week-day.current-workout, .day-card.current-day, .week-header.current-week) {
  background: linear-gradient(180deg, rgba(237, 244, 239, 0.98) 0%, rgba(224, 235, 228, 0.99) 100%);
  border-color: rgba(113, 133, 125, 0.28);
}

body[data-theme="light"] #page-calisthenics :is(.calendar-day.front-lever, .calendar-week-day.front-lever) {
  border-left-color: var(--cal-light-accent);
}

body[data-theme="light"] #page-calisthenics :is(.calendar-day.planche, .calendar-week-day.planche) {
  border-left-color: var(--cal-light-highlight);
}

body[data-theme="light"] #page-calisthenics :is(.calendar-day.rest-day, .calendar-week-day.rest-day) {
  background: rgba(135, 147, 141, 0.1);
}

body[data-theme="light"] #page-calisthenics .calendar-day.deload {
  background: rgba(191, 129, 67, 0.12);
}

body[data-theme="light"] #page-calisthenics .calendar-day.rest-day .calendar-day-workout {
  color: #667770;
}

body[data-theme="light"] #page-calisthenics .calendar-day.deload .calendar-day-workout {
  color: #8b6126;
}

body[data-theme="light"] #page-calisthenics .calendar-day.front-lever .calendar-day-workout {
  color: var(--cal-light-accent-strong);
}

body[data-theme="light"] #page-calisthenics .calendar-day.planche .calendar-day-workout {
  color: var(--cal-light-highlight);
}

body[data-theme="light"] #page-calisthenics :is(.week-type.normal, .calendar-week-number) {
  background: rgba(113, 133, 125, 0.14);
  color: var(--cal-light-accent-strong);
}

body[data-theme="light"] #page-calisthenics :is(.legend-color.front-lever, .legend-color.today) {
  background: var(--cal-light-accent);
  box-shadow: none;
}

body[data-theme="light"] #page-calisthenics .legend-color.planche {
  background: var(--cal-light-highlight);
}

body[data-theme="light"] #page-calisthenics .legend-color.rest {
  background: var(--cal-light-rest);
}

body[data-theme="light"] #page-calisthenics .legend-color.deload {
  background: var(--cal-light-warm);
}

body[data-theme="light"] #page-calisthenics :is(.calendar-day.missed-workout, .calendar-week-day.missed-workout) {
  background: repeating-linear-gradient(
    45deg,
    rgba(191, 129, 67, 0.05),
    rgba(191, 129, 67, 0.05) 8px,
    rgba(191, 129, 67, 0.11) 8px,
    rgba(191, 129, 67, 0.11) 16px
  ) !important;
  border-color: rgba(191, 129, 67, 0.34) !important;
}

body[data-theme="light"] #page-calisthenics :is(.calendar-day.today.missed-workout, .calendar-week-day.missed-workout.today) {
  border-color: var(--cal-light-accent) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84), 0 0 12px rgba(60, 98, 80, 0.16), inset 0 0 8px rgba(191, 129, 67, 0.14) !important;
}

body[data-theme="light"] #page-calisthenics :is(.calendar-day.missed-workout .calendar-day-workout, .calendar-day-workout.missed, .calendar-week-day.missed-workout .calendar-week-day-workout.missed, .calendar-week-day-rest-label) {
  color: #8b6126;
}

body[data-theme="light"] #page-calisthenics :is(.calendar-day.missed-workout .calendar-day-rest-label, .calendar-week-day-rest-label) {
  background: rgba(191, 129, 67, 0.16);
}

body[data-theme="light"] #page-calisthenics .day-card.missed-workout {
  background: linear-gradient(135deg, rgba(243, 229, 211, 0.82) 0%, rgba(242, 232, 235, 0.72) 100%) !important;
  border-color: rgba(191, 129, 67, 0.38) !important;
}

body[data-theme="light"] #page-calisthenics .day-card.missed-workout .day-name {
  color: #8b6126 !important;
}

body[data-theme="light"] .settings-container {
  border-top-color: rgba(82, 100, 93, 0.14);
}

body[data-theme="light"] .settings-btn,
body[data-theme="light"] .settings-dropdown,
body[data-theme="light"] .nav-menu-mobile :is(.lang-btn, .theme-btn, .logout-btn, .settings-link-btn),
body[data-theme="light"] #settingsDropdown :is(.lang-btn, .theme-btn, .logout-btn, .settings-link-btn) {
  background: linear-gradient(180deg, rgba(252, 253, 252, 0.98) 0%, rgba(239, 243, 240, 0.99) 100%);
  border-color: rgba(82, 100, 93, 0.16);
  color: var(--fc-text-light);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88), 0 10px 24px rgba(22, 34, 29, 0.08);
}

body[data-theme="light"] .settings-btn:hover,
body[data-theme="light"] .settings-btn:focus-visible,
body[data-theme="light"] #settingsDropdown :is(.lang-btn, .theme-btn, .logout-btn, .settings-link-btn):hover,
body[data-theme="light"] #settingsDropdown :is(.lang-btn, .theme-btn, .logout-btn, .settings-link-btn):focus-visible,
body[data-theme="light"] .nav-menu-mobile :is(.lang-btn, .theme-btn, .logout-btn, .settings-link-btn):hover,
body[data-theme="light"] .nav-menu-mobile :is(.lang-btn, .theme-btn, .logout-btn, .settings-link-btn):focus-visible {
  background: linear-gradient(180deg, rgba(255, 250, 251, 0.98) 0%, rgba(244, 235, 238, 0.99) 100%);
  border-color: rgba(47, 111, 91, 0.28);
  color: var(--fc-highlight);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 12px 24px rgba(17, 61, 49, 0.12);
}

body[data-theme="light"] #settingsDropdown :is(.lang-btn.active, .theme-btn.active),
body[data-theme="light"] .nav-menu-mobile :is(.lang-btn.active, .theme-btn.active) {
  background: linear-gradient(180deg, rgba(226, 236, 231, 0.99) 0%, rgba(214, 226, 220, 0.99) 100%);
  border-color: rgba(82, 100, 93, 0.3);
  color: var(--fc-text-light);
  box-shadow: inset 3px 0 0 rgba(82, 100, 93, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.88), 0 10px 22px rgba(22, 34, 29, 0.08);
}

body[data-theme="light"] .settings-dropdown {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(243, 247, 244, 0.99) 100%);
  border-color: rgba(82, 100, 93, 0.16);
}

body[data-theme="light"] .settings-user-name,
body[data-theme="light"] .settings-label,
body[data-theme="light"] .settings-user-role {
  color: var(--fc-text-light);
}

body[data-theme="light"] .settings-user-role {
  background: rgba(93, 111, 104, 0.1);
  border-color: rgba(82, 100, 93, 0.18);
}

body[data-theme="light"] .settings-divider,
body[data-theme="light"] .nav-menu-mobile .settings-divider {
  background: rgba(82, 100, 93, 0.12);
}

/* Helios pass, remove remaining legacy blue and burgundy accents */
body[data-theme="dark"] .status-indicator-modern.idle,
body[data-theme="dark"] .status-indicator.idle,
body[data-theme="dark"] .status-indicator.status-idle,
body[data-theme="light"] .status-indicator-modern.idle,
body[data-theme="light"] .status-indicator.idle,
body[data-theme="light"] .status-indicator.status-idle {
  background: #71857d;
}

body[data-theme="light"] .status-indicator-modern.idle,
body[data-theme="light"] .status-indicator.idle,
body[data-theme="light"] .status-indicator.status-idle {
  background: #8ea299;
}

body[data-theme="dark"] :is(.delegation-timer, .focus-session-badge.idle, .schedule-last-update, .group-selector-label, .download-item-file, .download-item-meta, .recent-activity-agent, .recent-activity-time),
body[data-theme="light"] :is(.delegation-timer, .focus-session-badge.idle, .schedule-last-update, .group-selector-label, .download-item-file, .download-item-meta, .recent-activity-agent, .recent-activity-time) {
  color: var(--fc-text-dark-muted);
  border-color: var(--fc-border-dark-strong);
}

body[data-theme="light"] :is(.delegation-timer, .focus-session-badge.idle, .schedule-last-update, .group-selector-label, .download-item-file, .download-item-meta, .recent-activity-agent, .recent-activity-time) {
  color: var(--fc-text-light-muted);
  border-color: var(--fc-border-light-strong);
}

body[data-theme="dark"] :is(.delegation-timer, .focus-session-badge.idle) {
  background: rgba(82, 100, 93, 0.16);
}

body[data-theme="light"] :is(.delegation-timer, .focus-session-badge.idle) {
  background: rgba(113, 133, 125, 0.12);
}

body[data-theme="dark"] .news-title-link:hover,
body[data-theme="light"] .news-title-link:hover {
  color: var(--fc-highlight);
  border-bottom-color: rgba(47, 111, 91, 0.35);
}

body[data-theme="dark"] :is(.news-tag.update, .news-tag.research),
body[data-theme="light"] :is(.news-tag.update, .news-tag.research) {
  background: rgba(47, 111, 91, 0.12);
  color: var(--fc-highlight-soft);
  border-color: rgba(47, 111, 91, 0.28);
}

body[data-theme="light"] :is(.news-tag.update, .news-tag.research) {
  color: var(--fc-highlight);
}

body[data-theme="dark"] #page-study-overview :is(.study-preview-pill, .study-review-week, .study-session-row, .study-session-chip),
body[data-theme="light"] #page-study-overview :is(.study-preview-pill, .study-review-week, .study-session-row, .study-session-chip) {
  border-color: rgba(113, 133, 125, 0.22);
}

body[data-theme="dark"] #page-study-overview .study-preview-pill {
  background: rgba(19, 24, 22, 0.72);
}

body[data-theme="dark"] #page-study-overview .study-preview-pill.is-active,
body[data-theme="dark"] #page-study-overview .study-review-week.is-current {
  border-color: rgba(113, 133, 125, 0.34);
  box-shadow: 0 0 0 1px rgba(113, 133, 125, 0.14) inset, 0 14px 28px rgba(17, 61, 49, 0.12);
  background: linear-gradient(180deg, rgba(22, 30, 27, 0.96) 0%, rgba(14, 19, 18, 0.98) 100%);
}

body[data-theme="dark"] #page-study-overview :is(.study-session-chip, .study-session-row) {
  background: rgba(20, 26, 24, 0.74);
}

body[data-theme="light"] #page-study-overview .study-preview-pill {
  background: #ffffff;
  border-color: rgba(113, 133, 125, 0.24);
  box-shadow: 0 10px 24px rgba(31, 45, 37, 0.06);
}

body[data-theme="light"] #page-study-overview .study-preview-pill.is-active,
body[data-theme="light"] #page-study-overview .study-review-week.is-current {
  border-color: rgba(113, 133, 125, 0.34);
  box-shadow: 0 0 0 1px rgba(113, 133, 125, 0.14) inset, 0 14px 28px rgba(31, 45, 37, 0.08);
  background: linear-gradient(180deg, #f4f8f5 0%, #ffffff 100%);
}

body[data-theme="light"] #page-study-overview :is(.study-session-chip, .study-session-row) {
  background: #f4f8f5;
}

body[data-theme="dark"] :is(.workout-badge.pull, .day-type-badge.pull, .exercise-icon.pull, .legend-color.front-lever),
body[data-theme="light"] :is(.workout-badge.pull, .day-type-badge.pull, .exercise-icon.pull, .legend-color.front-lever) {
  background: rgba(113, 133, 125, 0.18);
  color: #9bb2a9;
  border-color: rgba(113, 133, 125, 0.3);
}

body[data-theme="dark"] :is(.workout-badge.push, .day-type-badge.push, .exercise-icon.push, .legend-color.planche),
body[data-theme="light"] :is(.workout-badge.push, .day-type-badge.push, .exercise-icon.push, .legend-color.planche) {
  background: rgba(47, 111, 91, 0.18);
  color: #84b39f;
  border-color: rgba(47, 111, 91, 0.3);
}

body[data-theme="dark"] :is(.calendar-day.front-lever .calendar-day-workout, .calendar-day.planche .calendar-day-workout),
body[data-theme="light"] :is(.calendar-day.front-lever .calendar-day-workout, .calendar-day.planche .calendar-day-workout) {
  color: var(--fc-highlight);
}

/* Final dark-mode nutrition slot cleanup: force a coherent forest palette in Daily entries/composer UI */
body[data-theme="dark"] #page-nutrition {
  --nutrition-slot-surface: linear-gradient(180deg, rgba(20, 31, 27, 0.94) 0%, rgba(14, 21, 19, 0.985) 100%);
  --nutrition-slot-surface-raised: linear-gradient(180deg, rgba(24, 37, 31, 0.95) 0%, rgba(16, 24, 21, 0.99) 100%);
  --nutrition-slot-surface-soft: linear-gradient(180deg, rgba(22, 34, 29, 0.88) 0%, rgba(15, 22, 20, 0.96) 100%);
  --nutrition-slot-border: rgba(132, 152, 145, 0.22);
  --nutrition-slot-border-strong: rgba(132, 152, 145, 0.34);
  --nutrition-slot-glow: rgba(47, 111, 91, 0.1);
  --nutrition-slot-glow-strong: rgba(47, 111, 91, 0.16);
}

body[data-theme="dark"] #page-nutrition :is(
  .nutrition-inline-composer,
  .nutrition-slot-card,
  .nutrition-slot-inline-composer,
  .nutrition-favorites-block,
  .nutrition-explicit-editor,
  .nutrition-profile-disclosure,
  .nutrition-busy-state,
  .nutrition-detail-card,
  .nutrition-entry-item
) {
  background: var(--nutrition-slot-surface-soft);
  border-color: var(--nutrition-slot-border);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

body[data-theme="dark"] #page-nutrition .nutrition-slot-card {
  background:
    var(--nutrition-slot-surface),
    radial-gradient(circle at top right, var(--nutrition-slot-glow) 0%, rgba(47, 111, 91, 0) 62%);
  border-color: var(--nutrition-slot-border-strong);
}

body[data-theme="dark"] #page-nutrition .nutrition-slot-card:hover,
body[data-theme="dark"] #page-nutrition .nutrition-slot-card.active,
body[data-theme="dark"] #page-nutrition .nutrition-slot-card.drag-target {
  background:
    var(--nutrition-slot-surface-raised),
    radial-gradient(circle at top right, var(--nutrition-slot-glow-strong) 0%, rgba(47, 111, 91, 0) 58%);
}

body[data-theme="dark"] #page-nutrition .nutrition-slot-card.active {
  border-color: rgba(47, 111, 91, 0.42);
  box-shadow: inset 0 0 0 1px rgba(132, 152, 145, 0.1), 0 16px 30px rgba(8, 14, 11, 0.22);
}

body[data-theme="dark"] #page-nutrition .nutrition-slot-card.drag-target {
  border-color: rgba(132, 152, 145, 0.4);
  box-shadow: inset 0 0 0 1px rgba(132, 152, 145, 0.12), 0 0 0 4px rgba(132, 152, 145, 0.08);
}

body[data-theme="dark"] #page-nutrition .nutrition-slot-inline-composer,
body[data-theme="dark"] #page-nutrition .nutrition-inline-composer {
  background:
    linear-gradient(180deg, rgba(23, 36, 30, 0.9) 0%, rgba(15, 23, 20, 0.98) 100%),
    radial-gradient(circle at top right, rgba(47, 111, 91, 0.08) 0%, rgba(47, 111, 91, 0) 60%);
  border-color: var(--nutrition-slot-border-strong);
}

body[data-theme="dark"] #page-nutrition :is(.nutrition-slot-header, .nutrition-slot-inline-composer-head, .nutrition-favorites-head) {
  color: var(--fc-text-dark-soft);
}

body[data-theme="dark"] #page-nutrition :is(.nutrition-slot-inline-composer-head strong, .nutrition-favorites-head strong, .nutrition-explicit-editor summary, .nutrition-entry-title) {
  color: var(--fc-text-dark);
}

body[data-theme="dark"] #page-nutrition :is(input, select, textarea) {
  background: linear-gradient(180deg, rgba(18, 29, 24, 0.96) 0%, rgba(13, 20, 18, 0.99) 100%) !important;
  border-color: rgba(132, 152, 145, 0.24) !important;
}

body[data-theme="dark"] #page-nutrition :is(input, select, textarea):focus {
  border-color: rgba(132, 152, 145, 0.42) !important;
  box-shadow: 0 0 0 3px rgba(132, 152, 145, 0.16);
}

body[data-theme="dark"] #page-nutrition :is(.nutrition-favorites-block, .nutrition-explicit-editor, .nutrition-profile-disclosure) {
  background:
    linear-gradient(180deg, rgba(20, 32, 27, 0.86) 0%, rgba(14, 21, 19, 0.96) 100%),
    radial-gradient(circle at top right, rgba(47, 111, 91, 0.06) 0%, rgba(47, 111, 91, 0) 62%);
  border-color: var(--nutrition-slot-border);
}

body[data-theme="dark"] #page-nutrition .nutrition-favorite-chip {
  background: linear-gradient(180deg, rgba(26, 40, 33, 0.86) 0%, rgba(16, 24, 21, 0.96) 100%);
  border-color: rgba(132, 152, 145, 0.28);
}

body[data-theme="dark"] #page-nutrition .nutrition-favorite-chip:hover {
  background: linear-gradient(180deg, rgba(29, 46, 37, 0.88) 0%, rgba(17, 26, 22, 0.98) 100%);
  border-color: rgba(47, 111, 91, 0.42);
}

body[data-theme="dark"] #page-nutrition .nutrition-favorite-chip-delete {
  border-left-color: rgba(132, 152, 145, 0.2);
  color: var(--fc-text-dark-soft);
}

body[data-theme="dark"] #page-nutrition .nutrition-empty-slot {
  background:
    linear-gradient(180deg, rgba(20, 31, 27, 0.72) 0%, rgba(14, 21, 19, 0.88) 100%),
    radial-gradient(circle at top right, rgba(47, 111, 91, 0.05) 0%, rgba(47, 111, 91, 0) 62%);
  border-color: rgba(132, 152, 145, 0.24);
}

body[data-theme="dark"] #page-nutrition :is(.health-check-badge, .nutrition-slot-controls .health-check-badge) {
  background: linear-gradient(180deg, rgba(30, 44, 38, 0.82) 0%, rgba(18, 27, 24, 0.94) 100%);
  border-color: rgba(132, 152, 145, 0.24);
  color: var(--fc-accent-soft);
}

body[data-theme="dark"] #page-nutrition :is(.nutrition-slot-add-btn, .nutrition-edit-btn, .nutrition-cancel-btn) {
  background: linear-gradient(180deg, rgba(31, 45, 39, 0.82) 0%, rgba(18, 27, 24, 0.94) 100%);
  border-color: rgba(132, 152, 145, 0.28);
  color: var(--fc-accent-soft);
}

body[data-theme="dark"] #page-nutrition :is(.nutrition-slot-add-btn:hover, .nutrition-edit-btn:hover, .nutrition-cancel-btn:hover, .nutrition-slot-add-btn:focus-visible, .nutrition-edit-btn:focus-visible, .nutrition-cancel-btn:focus-visible) {
  background: linear-gradient(180deg, rgba(35, 51, 43, 0.88) 0%, rgba(20, 30, 26, 0.98) 100%);
  border-color: rgba(47, 111, 91, 0.42);
  color: var(--fc-text-dark);
}

body[data-theme="dark"] #page-nutrition .nutrition-delete-btn {
  background: linear-gradient(180deg, rgba(29, 42, 37, 0.8) 0%, rgba(17, 25, 22, 0.94) 100%);
  border-color: rgba(95, 127, 114, 0.28);
  color: #d8e4de;
}

body[data-theme="dark"] #page-nutrition .nutrition-delete-btn:hover {
  border-color: rgba(47, 111, 91, 0.42);
  color: var(--fc-text-dark);
}

body[data-theme="dark"] #page-nutrition details.nutrition-explicit-editor > summary::after,
body[data-theme="dark"] #page-nutrition .nutrition-profile-disclosure > summary::after {
  color: var(--fc-accent-soft);
}
