/* Student web screens use the same palette as the coach panel. */
html[data-color-theme="dark"] .student-theme-ui {
  --navy: var(--hp-text);
  --navy-deep: var(--hp-text);
  --slatecopy: var(--hp-muted);
  --green: var(--hp-success-text);
  --mint: var(--hp-success-bg);
  --border: var(--hp-border);
  --text: var(--hp-text);
  --mist: var(--hp-raised);
}

/* Home, profile and upload screens. */
html[data-color-theme="dark"] .student-theme-ui :is(
  .student-panel, .student-hero, .student-home-grid, .student-home-card,
  .student-cardio-summary, .student-chart-card, .student-adherence-card,
  .profile-section, .profile-section[open], .profile-section-metrics[open],
  .profile-answer-group, .initial-metric-info p, .metric-history-stat,
  .metric-history-table-wrap, .metric-history-table td:first-child,
  .checkin-observations, .checkin-coach-reply, .checkin-photo-set,
  .checkin-disabled-form .panel, .photo-preview-dialog, .photo-upload-slot,
  .photo-upload-slot-optional, .receipt-file-card, .medical-file-card, .video-file-card,
  .notification-feed, .notification-preference-card, .notification-empty
) { background: var(--hp-surface); color: var(--hp-text); border-color: var(--hp-border); box-shadow: none; }
html[data-color-theme="dark"] .student-theme-ui :is(
  .student-home-macro, .student-cardio-row, .student-progress-switch,
  .student-progress-chart, .student-report-schedule, .profile-preview-item,
  .profile-metric-field, .profile-hero-chip, .profile-section-count, .profile-icon-button,
  .initial-metric-field, .metric-history-chart, .metric-history-view-switch,
  .metric-history-periods, .metric-history-table th, .metric-history-table th:first-child,
  .checkin-recurring-chevron, .checkin-feedback-chevron, .checkin-feedback-context,
  .checkin-measurement-history-value, .photo-upload-optional, .photo-slot-title,
  .photo-slot-file, .photo-slot-preview-button, .photo-preview-dialog-close,
  .receipt-file-icon, .receipt-history-icon, .receipt-history-action,
  .medical-file-icon, .video-file-icon, .notification-feed-toolbar,
  .notification-filters, .notification-kind-icon, .notification-preference-icon
) { background: var(--hp-raised); color: var(--hp-text); border-color: var(--hp-border); box-shadow: none; }
html[data-color-theme="dark"] .student-theme-ui :is(.student-home-card:hover, .profile-icon-button:hover, .notification-card:hover) { background: var(--hp-hover-surface); border-color: var(--hp-hover-border); }
html[data-color-theme="dark"] .student-theme-ui :is(.student-home-macro-key, .student-home-macro-carbs .student-home-macro-key, .student-home-macro-protein .student-home-macro-key, .student-home-macro-fat .student-home-macro-key) { color: var(--hp-muted); }
html[data-color-theme="dark"] .student-theme-ui :is(.student-weight-change, .guide-read-badge, .profile-save-status[data-state="success"]) { background: var(--hp-success-bg); color: var(--hp-success-text); }
html[data-color-theme="dark"] .student-theme-ui :is(.student-weight-change-up, .profile-missing-chip, .checkin-report-state.is-missed) { background: var(--hp-warning-bg); color: var(--hp-warning-text); }
html[data-color-theme="dark"] .student-theme-ui :is(.student-weight-change-stable, .receipt-history-count) { background: var(--hp-neutral-bg); color: var(--hp-neutral-text); }
html[data-color-theme="dark"] .student-theme-ui :is(.profile-save-status[data-state="error"], .initial-metric-error) { color: var(--hp-destructive-text); }
html[data-color-theme="dark"] .student-theme-ui :is(.student-progress-switch button[aria-selected="true"], .metric-history-view-switch button[aria-selected="true"], .receipt-file-action, .medical-file-action, .video-file-action) { background: var(--hp-accent-fill); color: var(--hp-on-accent); border-color: var(--hp-selected-outline); box-shadow: inset 0 0 0 1px var(--hp-selected-outline); }
html[data-color-theme="dark"] .student-theme-ui :is(.student-track, .profile-progress-track, .guide-progress-track, .nutrition-history-week-card-progress) { background: var(--hp-neutral-bg); }
html[data-color-theme="dark"] .student-theme-ui :is(.student-track-fill, .profile-progress-fill, .guide-progress-track > span, .nutrition-history-week-card-progress > span) { background: var(--hp-accent); }
html[data-color-theme="dark"] .student-theme-ui .student-hero::before { background: var(--hp-accent-fill); }
html[data-color-theme="dark"] .student-theme-ui :is(.student-chart-grid, .metric-history-grid-line, .nutrition-history-chart-grid) { stroke: var(--hp-border); }
html[data-color-theme="dark"] .student-theme-ui :is(.student-chart-axis, .metric-history-axis-line) { stroke: var(--hp-control-border); }
html[data-color-theme="dark"] .student-theme-ui :is(.student-chart-line, .student-chart-dot) { stroke: var(--hp-accent); }
html[data-color-theme="dark"] .student-theme-ui :is(.student-chart-line-waist, .student-chart-dot-waist, .metric-history-line-waist, .metric-history-dot-waist) { stroke: var(--hp-chart-comparison); }
html[data-color-theme="dark"] .student-theme-ui :is(.student-chart-dot, .metric-history-dot) { fill: var(--hp-surface); }
html[data-color-theme="dark"] .student-theme-ui :is(.student-chart-axis-label, .student-chart-axis-title, .nutrition-history-chart-axis, .nutrition-history-chart-date) { fill: var(--hp-muted); }
html[data-color-theme="dark"] .student-theme-ui :is(.photo-preview-dialog, .nutrition-extra-dialog)::backdrop { background: rgba(0, 0, 0, .65); }
html[data-color-theme="dark"] .student-theme-ui .photo-preview-dialog-image { background: var(--hp-page); }
html[data-color-theme="dark"] .student-theme-ui :is(.receipt-file-card, .medical-file-card, .video-file-card).is-error { background: var(--hp-danger-bg); border-color: var(--hp-destructive-text); color: var(--hp-destructive-text); }
html[data-color-theme="dark"] .student-theme-ui :is(.receipt-file-card, .medical-file-card, .video-file-card).has-file { background: var(--hp-success-bg); border-color: var(--hp-success-border); }
html[data-color-theme="dark"] .student-theme-ui :is(.notification-unread-dot, .checkin-report-state::before) { background: var(--hp-accent); }
html[data-color-theme="dark"] .student-theme-ui .notification-card.is-unread { background: var(--hp-accent-faint); border-color: var(--hp-hover-border); }
html[data-color-theme="dark"] .student-theme-ui .notification-empty > span { background: var(--hp-success-bg); color: var(--hp-success-text); }

/* Nutrition and daily supplement / medication checklists. */
html[data-color-theme="dark"] .student-theme-ui :is(
  .nutrition-focus-panel, .nutrition-focus-macro, .supplement-quick-grid,
  .supplement-quick-grid > .supplement-quick-row, .supplement-cart-item,
  .supplement-dialog, .supplement-dialog > .attachment-dialog-actions,
  .medication-schedule-dialog, .medication-quick-row
) { background: var(--hp-surface); color: var(--hp-text); border-color: var(--hp-border); box-shadow: none; }
html[data-color-theme="dark"] .student-theme-ui #daily-checklist .nutrition-quick-list > .nutrition-quick-row { background: var(--hp-surface); color: var(--hp-text); border-color: var(--hp-border); }
html[data-color-theme="dark"] .student-theme-ui #daily-checklist .nutrition-quick-list > .nutrition-quick-row:is(:hover, :focus-visible) { background: var(--hp-hover-surface); }
html[data-color-theme="dark"] .student-theme-ui #daily-checklist .nutrition-quick-list > .nutrition-quick-row :is(.nutrition-quick-amount, .nutrition-quick-indicator) { background: var(--hp-raised); color: var(--hp-text); border-color: var(--hp-control-border); }
html[data-color-theme="dark"] .student-theme-ui #daily-checklist .nutrition-quick-list > .nutrition-quick-row[data-quick-log-status="completed"] { background: var(--hp-success-bg); border-color: var(--hp-success-border); }
html[data-color-theme="dark"] .student-theme-ui #daily-checklist .nutrition-quick-list > .nutrition-quick-row[data-quick-log-status="completed"] .nutrition-quick-indicator { background: var(--hp-accent-fill); color: var(--hp-on-accent); }
html[data-color-theme="dark"] .student-theme-ui :is(.nutrition-focus-track, .supplement-status-option-mark) { background: var(--hp-neutral-bg); }
html[data-color-theme="dark"] .student-theme-ui .nutrition-focus-track span { background: var(--hp-accent); }
html[data-color-theme="dark"] .student-theme-ui :is(.nutrition-focus-status, .nutrition-focus-macro[data-nutrition-macro-state="low"], .nutrition-focus-macro[data-nutrition-macro-state="low"] .nutrition-macro-pill, .supplement-row-status[data-status="skipped"], .supplement-quick-row[data-quick-log-status="skipped"]) { background: var(--hp-warning-bg); color: var(--hp-warning-text); border-color: var(--hp-warning-border); }
html[data-color-theme="dark"] .student-theme-ui :is(.nutrition-focus-macro[data-nutrition-macro-state="high"], .nutrition-focus-macro[data-nutrition-macro-state="high"] .nutrition-macro-pill) { background: var(--hp-danger-bg); color: var(--hp-danger-text); border-color: var(--hp-destructive-text); }
html[data-color-theme="dark"] .student-theme-ui :is(.nutrition-focus-meta[data-nutrition-macro-complete="true"] .nutrition-focus-status, .nutrition-focus-macro[data-nutrition-macro-state="ok"], .nutrition-focus-macro[data-nutrition-macro-state="ok"] .nutrition-macro-pill, .supplement-row-status[data-status="taken"], .supplement-quick-grid > .supplement-quick-row[data-quick-log-status="taken"]) { background: var(--hp-success-bg); color: var(--hp-success-text); border-color: var(--hp-success-border); }
html[data-color-theme="dark"] .student-theme-ui :is(.supplement-row-status, .supplement-row-status[data-status="missing"], .supplement-quick-indicator, .medication-quick-indicator, .supplement-status-option, .supplement-product-link, .supplement-quick-undo button, .supplement-note-info-button) { background: var(--hp-raised); color: var(--hp-text); border-color: var(--hp-control-border); box-shadow: none; }
html[data-color-theme="dark"] .student-theme-ui :is(.supplement-cart-button, .supplement-cart-product-link, .supplement-quick-undo, .supplement-quick-row[data-quick-log-status="taken"] .supplement-quick-indicator, .medication-quick-row[data-quick-log-status="taken"] .medication-quick-indicator) { background: var(--hp-accent-fill); color: var(--hp-on-accent); border-color: var(--hp-accent-fill); }
html[data-color-theme="dark"] .student-theme-ui .supplement-quick-row[data-quick-log-status="skipped"] .supplement-quick-indicator { background: var(--hp-warning-bg); color: var(--hp-warning-text); border-color: var(--hp-warning-text); }
html[data-color-theme="dark"] .student-theme-ui .supplement-quick-row[data-quick-log-status="skipped"] .supplement-quick-indicator::after { color: var(--hp-warning-text); }
html[data-color-theme="dark"] .student-theme-ui :is(.nutrition-history-day-substatus.attention, .supplement-history-day-metric small.is-attention) { color: var(--hp-warning-text); }
html[data-color-theme="dark"] .student-theme-ui :is(.nutrition-history-day-substatus.good, .supplement-history-day-metric small) { color: var(--hp-success-text); }
html[data-color-theme="dark"] .student-theme-ui .supplement-history-rhythm-bar { background: var(--hp-accent); }
html[data-color-theme="dark"] .student-theme-ui .supplement-history-rhythm-bar.is-low { background: var(--hp-warning-indicator); }

/* Guide choices and profile radio groups retain an explicit selected state. */
html[data-color-theme="dark"] .student-theme-ui :is(.guide-stage-tab.is-active, .guide-step-list a[aria-current="step"], .profile-section-body .form-control:has(input[type="radio"]) label:has(input:checked)) { background: var(--hp-accent-fill); color: var(--hp-on-accent); border-color: var(--hp-selected-outline); box-shadow: inset 0 0 0 1px var(--hp-selected-outline); }
html[data-color-theme="dark"] .student-theme-ui :is(.guide-stage-tab.is-active, .guide-step-list a[aria-current="step"]) :is(strong, small, span) { color: var(--hp-on-accent); }
html[data-color-theme="dark"] .student-theme-ui .profile-section-body .form-control:has(input[type="radio"]) label { background: var(--hp-raised); color: var(--hp-text); border-color: var(--hp-control-border); }
html[data-color-theme="dark"] .student-theme-ui .profile-section-body .form-control:has(input[type="radio"]) label::before { background: var(--hp-surface); border-color: var(--hp-control-border); }
html[data-color-theme="dark"] .student-theme-ui .profile-section-body .form-control:has(input[type="radio"]) label:has(input:checked)::before { background: var(--hp-accent); border-color: var(--hp-accent); }

/* Legacy focused workout mode is still reachable from a saved link. */
html[data-color-theme="dark"] .student-theme-ui :is(.training-info-dialog, .training-active-card, .training-history, .training-current-sets, .training-actions) { background: var(--hp-surface); border-color: var(--hp-border); color: var(--hp-text); box-shadow: none; }
html[data-color-theme="dark"] .student-theme-ui :is(.training-clock-pill, .training-exit, .training-timer, .training-history-chip, .training-info-trigger, .training-info-close, .training-info-foot, .training-stepper, .training-stepper-button, .training-rir-button, .training-current-row, .training-current-row strong, .training-alt-actions, .training-alt-button, .training-next-exercise) { background: var(--hp-raised); border-color: var(--hp-border); color: var(--hp-text); box-shadow: none; }
html[data-color-theme="dark"] .student-theme-ui :is(.training-actions .btn-primary, .training-rir-button[aria-pressed="true"]) { background: var(--hp-accent-fill); color: var(--hp-on-accent); border-color: var(--hp-selected-outline); }
html[data-color-theme="dark"] .student-theme-ui :is(.training-actions .btn-secondary, .training-field input) { background: var(--hp-raised); color: var(--hp-text); border-color: var(--hp-control-border); }
html[data-color-theme="dark"] .student-theme-ui .training-progress { background: var(--hp-neutral-bg); }
html[data-color-theme="dark"] .student-theme-ui .training-progress span { background: var(--hp-accent); }
html[data-color-theme="dark"] .student-theme-ui .training-info-backdrop { background: rgba(0, 0, 0, .65); }

/* Extra-food entry, including manual, search and AI review steps. */
html[data-color-theme="dark"] .student-theme-ui :is(
  .nutrition-extra-dialog, .nutrition-extra-dialog__surface, .nutrition-extra-log,
  .nutrition-extra-entry, .nutrition-extra-result-option, .nutrition-extra-question-card
) { background: var(--hp-surface); color: var(--hp-text); border-color: var(--hp-border); box-shadow: none; }
html[data-color-theme="dark"] .student-theme-ui :is(
  .nutrition-extra-entry__macros div, .nutrition-extra-selection__macros div,
  .nutrition-extra-unit-lock, .nutrition-extra-ai-card, .nutrition-extra-notice,
  .nutrition-extra-photo > label, .nutrition-extra-photo__preview,
  .nutrition-extra-review-steps li span, .nutrition-extra-choice label,
  .nutrition-extra-review-notes > div, .nutrition-extra-dialog__close,
  .nutrition-extra-dialog__nav, .medication-quick-grid,
  .medication-quick-grid > .medication-quick-row,
  .medication-matrix-compact :is(th, td), .medication-matrix-compact thead .sticky-col,
  .medication-schedule-dialog-section, .medication-schedule-dialog-note
) { background: var(--hp-raised); color: var(--hp-text); border-color: var(--hp-border); box-shadow: none; }
html[data-color-theme="dark"] .student-theme-ui :is(.nutrition-extra-primary-action, .nutrition-extra-selection__check, .nutrition-extra-ai-card__icon, .nutrition-extra-question-intro > span, .nutrition-extra-review-steps li[data-state="complete"] span, .nutrition-extra-result-summary__check) { background: var(--hp-accent-fill); color: var(--hp-on-accent); }
html[data-color-theme="dark"] .student-theme-ui :is(.nutrition-extra-choice input:checked + label, .nutrition-extra-review-steps li[data-state="active"]) { background: var(--hp-accent-fill); color: var(--hp-on-accent); border-color: var(--hp-selected-outline); }
html[data-color-theme="dark"] .student-theme-ui :is(.nutrition-extra-result-option:hover, .nutrition-extra-ai-card:hover, .nutrition-extra-photo > label:hover) { background: var(--hp-hover-surface); border-color: var(--hp-hover-border); }
html[data-color-theme="dark"] .student-theme-ui :is(.nutrition-extra-result-summary, .nutrition-extra-confidence, .nutrition-extra-entry__source--catalog, .nutrition-extra-entry__source--library, .medication-quick-grid > .medication-quick-row[data-quick-log-status="taken"]) { background: var(--hp-success-bg); color: var(--hp-success-text); border-color: var(--hp-success-border); }
html[data-color-theme="dark"] .student-theme-ui :is(.nutrition-extra-confidence[data-level="medium"], .nutrition-extra-notice--warning, .nutrition-extra-notice--warning > span) { background: var(--hp-warning-bg); color: var(--hp-warning-text); border-color: var(--hp-warning-border); }
html[data-color-theme="dark"] .student-theme-ui :is(.nutrition-extra-confidence[data-level="low"], .nutrition-extra-inline-error, .nutrition-extra-failed__icon, .nutrition-extra-search-state--error, .nutrition-extra-toast--error) { background: var(--hp-danger-bg); color: var(--hp-destructive-text); border-color: var(--hp-destructive-text); }
html[data-color-theme="dark"] .student-theme-ui :is(.nutrition-extra-text-button--danger, .nutrition-extra-icon-button--danger:hover) { color: var(--hp-destructive-text); }
html[data-color-theme="dark"] .student-theme-ui .nutrition-extra-toast { background: var(--hp-success-bg); color: var(--hp-success-text); border-color: var(--hp-success-border); }
html[data-color-theme="dark"] .student-theme-ui .nutrition-extra-toast--error { background: var(--hp-danger-bg); color: var(--hp-destructive-text); border-color: var(--hp-destructive-text); }
html[data-color-theme="dark"] .student-theme-ui :is(.medication-quick-meta-prominent, .medication-matrix-toggle-icon, .nutrition-extra-log__count, .nutrition-extra-entry__source, .nutrition-extra-notice > span) { background: var(--hp-neutral-bg); color: var(--hp-neutral-text); }
html[data-color-theme="dark"] .student-theme-ui .nutrition-extra-dialog :is(input, select, textarea) { background: var(--hp-raised); color: var(--hp-text); border-color: var(--hp-control-border); }
html[data-color-theme="dark"] .student-theme-ui .client-survey-card { background: var(--hp-surface); color: var(--hp-text); border-color: var(--hp-border); box-shadow: none; }
html[data-color-theme="dark"] .student-theme-ui :is(.guide-prose, .guide-prose p, .guide-key-points li) { color: var(--hp-text); }
html[data-color-theme="dark"] .student-theme-ui #main-content a.conversation-row.conversation-row-active[aria-current="page"] { background: var(--hp-accent-soft); border-color: var(--hp-border); color: var(--hp-text); box-shadow: inset 4px 0 0 var(--hp-selected-outline); }
html[data-color-theme="dark"] .student-theme-ui .mobile-action-dock { background: var(--hp-surface); color: var(--hp-text); border-color: var(--hp-border); box-shadow: none; }
html[data-color-theme="dark"] .student-theme-ui .guide-context-link { background: var(--hp-accent-soft); color: var(--hp-accent); border-color: var(--hp-hover-border); }

/* Preparation requirements appear automatically for new students. */
html[data-color-theme="dark"] .student-theme-ui :is(.client-upload-dialog, .client-upload-body, .client-upload-step, .client-upload-quick-link) { background: var(--hp-surface); color: var(--hp-text); border-color: var(--hp-border); box-shadow: none; }
html[data-color-theme="dark"] .student-theme-ui :is(.client-upload-head, .client-upload-payment-details, .client-upload-close, .client-upload-copy-button, .client-upload-countdown, .client-upload-support) { background: var(--hp-raised); color: var(--hp-text); border-color: var(--hp-border); box-shadow: none; }
html[data-color-theme="dark"] .student-theme-ui :is(.client-upload-guide-button, .client-upload-support-link, .client-upload-support-whatsapp) { background: var(--hp-accent-fill); color: var(--hp-on-accent); border-color: var(--hp-accent-fill); box-shadow: none; }
html[data-color-theme="dark"] .student-theme-ui :is(.client-upload-step-title, .client-upload-payment-heading, .client-upload-iban-value, .client-upload-countdown strong, .client-upload-support strong) { color: var(--hp-text); }
html[data-color-theme="dark"] .student-theme-ui :is(.client-upload-step-detail, .client-upload-payment-row, .client-upload-message, .client-upload-support small) { color: var(--hp-muted); }
html[data-color-theme="dark"] .student-theme-ui :is(.client-upload-quick-link.is-complete, .client-upload-step-action.is-complete) { background: var(--hp-success-bg); color: var(--hp-success-text); border-color: var(--hp-success-border); }
html[data-color-theme="dark"] .student-theme-ui .client-upload-backdrop { background: rgba(0, 0, 0, .65); }

/* Sign-in and recovery preserve the same saved web appearance. */
.topbar .auth-appearance-menu { display: block; margin-left: auto; }
html[data-color-theme="dark"] .student-theme-ui .login-page { background: var(--hp-page); }
html[data-color-theme="dark"] .student-theme-ui .login-card { background: var(--hp-surface); color: var(--hp-text); border-color: var(--hp-border); box-shadow: none; }
html[data-color-theme="dark"] .student-theme-ui .login-card::before { background: var(--hp-accent-fill); }
html[data-color-theme="dark"] .student-theme-ui #main-content .login-page .btn-primary { background: var(--hp-accent-fill); border-color: var(--hp-accent-fill); color: var(--hp-on-accent); box-shadow: none; }
html[data-color-theme="dark"] .student-theme-ui .login-page .form-control { background: var(--hp-raised); color: var(--hp-text); border-color: var(--hp-control-border); box-shadow: none; }
html[data-color-theme="dark"] .student-theme-ui .client-next-action-card { background: var(--hp-raised); color: var(--hp-text); border-color: var(--hp-border); }
html[data-color-theme="dark"] .student-theme-ui .client-next-action-card :is(h1, p) { color: var(--hp-text) !important; }

html[data-color-theme="dark"] .student-theme-ui :is(
  .panel, .client-workout-days-panel, .workout-days-grid, .workout-day-card,
  .workout-day-body, .workout-latest-session
) {
  background: var(--hp-surface);
  border-color: var(--hp-border);
  color: var(--hp-text);
  box-shadow: none;
}
html[data-color-theme="dark"] .student-theme-ui :is(
  .client-workout-section-head, .workout-day-summary, .workout-exercise-row,
  .client-cardio-card, .workout-day-mobile-icon,
  [class*="bg-sand/"], [class*="bg-mint/"], .bg-white
) {
  background: var(--hp-raised);
  border-color: var(--hp-border);
  color: var(--hp-text);
  box-shadow: none;
}
html[data-color-theme="dark"] .student-theme-ui :is(
  .text-navy, .workout-day-title, .workout-exercise-name, .workout-exercise-chip-value,
  .client-cardio-title, .field-label
) { color: var(--hp-text); }
html[data-color-theme="dark"] .student-theme-ui :is(
  .text-slatecopy, .screen-copy, .field-help, .helptext, .client-cardio-detail,
  .client-cardio-footer, .client-cardio-note
) { color: var(--hp-muted); }
html[data-color-theme="dark"] .student-theme-ui :is(
  .text-orange, .context-guide-link, .client-cardio-icon
) { color: var(--hp-accent); }
html[data-color-theme="dark"] .student-theme-ui :is(
  .workout-exercise-chip, .workout-exercise-chip-icon
) { background: var(--hp-neutral-bg); color: var(--hp-neutral-text); border-color: var(--hp-border); box-shadow: none; }
html[data-color-theme="dark"] .student-theme-ui .workout-exercise-chip-reps { background: var(--hp-accent-soft); color: var(--hp-accent); }
html[data-color-theme="dark"] .student-theme-ui .workout-exercise-chip-icon-reps { color: var(--hp-accent); background: transparent; }
html[data-color-theme="dark"] .student-theme-ui .workout-exercise-chip-intensity { background: var(--hp-warning-bg); color: var(--hp-warning-text); border-color: var(--hp-warning-border); }
html[data-color-theme="dark"] .student-theme-ui .workout-exercise-chip-icon-intensity { color: var(--hp-warning-text); background: transparent; }
html[data-color-theme="dark"] .student-theme-ui .workout-exercise-chip-reps .workout-exercise-chip-value { color: var(--hp-accent); }
html[data-color-theme="dark"] .student-theme-ui .workout-day-mobile-icon-primary { background: var(--hp-accent-fill); color: var(--hp-on-accent); border-color: var(--hp-accent-fill); }
html[data-color-theme="dark"] .student-theme-ui .client-cardio-icon { background: var(--hp-accent-soft); }
html[data-color-theme="dark"] .student-theme-ui .program-upcoming-value { color: var(--hp-success-text); }
html[data-color-theme="dark"] .student-theme-ui :is(.border-line, .client-cardio-footer, .client-cardio-note) { border-color: var(--hp-border); }
html[data-color-theme="dark"] .student-theme-ui .workout-day-card:hover { border-color: var(--hp-hover-border); box-shadow: none; }
html[data-color-theme="dark"] .student-theme-ui :is(.icon-button, .notification-nav-button, .client-communication-nav) { background: var(--hp-raised); border-color: var(--hp-border); color: var(--hp-text); box-shadow: none; }
html[data-color-theme="dark"] .student-theme-ui .notification-nav-badge { background: var(--hp-danger-bg); border-color: var(--hp-page); color: var(--hp-destructive-text); }
html[data-color-theme="dark"] .student-theme-ui .skip-link { background: var(--hp-accent-fill); color: var(--hp-on-accent); }

/* Workout history and completed session details. */
html[data-color-theme="dark"] .student-theme-ui :is(
  .student-workout-panel, .student-workout-stat, .student-workout-movement-metric,
  .student-workout-movement-point, .student-workout-set, .summary-tile,
  .panel-muted, .checklist-row, .exercise-note-content
) { background: var(--hp-surface); border-color: var(--hp-border); color: var(--hp-text); box-shadow: none; }
html[data-color-theme="dark"] .student-theme-ui :is(
  .student-workout-periods, .student-workout-rhythm-track, .student-workout-movement-body,
  .student-workout-session-body, .student-workout-movement-toggle,
  .set-mini-list, .set-mini-item, .exercise-note-summary
) { background: var(--hp-raised); border-color: var(--hp-border); color: var(--hp-text); box-shadow: none; }
html[data-color-theme="dark"] .student-theme-ui .student-workout-period { color: var(--hp-text); }
html[data-color-theme="dark"] .student-theme-ui .student-workout-period.is-active {
  background: var(--hp-accent-fill); color: var(--hp-on-accent);
  box-shadow: inset 0 0 0 1px var(--hp-selected-outline);
}
html[data-color-theme="dark"] .student-theme-ui .student-workout-change { background: var(--hp-success-bg); color: var(--hp-success-text); border-color: var(--hp-success-border); }
html[data-color-theme="dark"] .student-theme-ui :is(.student-workout-change.is-down, .student-workout-attention-row) { background: var(--hp-warning-bg); color: var(--hp-warning-text); border-color: var(--hp-warning-border); }
html[data-color-theme="dark"] .student-theme-ui .student-workout-rhythm-bar { background: var(--hp-accent); }
html[data-color-theme="dark"] .student-theme-ui .progress-track { background: var(--hp-neutral-bg); }
html[data-color-theme="dark"] .student-theme-ui :is(.progress-fill, .bg-green) { background: var(--hp-success-indicator); }

/* Entry form, set table and its status controls. */
html[data-color-theme="dark"] .student-theme-ui :is(
  .workout-log-sticky-summary, .workout-log-table-row, .workout-table-stepper,
  .workout-status-action, .workout-status-action-muted
) { background: var(--hp-surface); border-color: var(--hp-border); color: var(--hp-text); box-shadow: none; }
html[data-color-theme="dark"] .student-theme-ui :is(
  .workout-log-table-head, .workout-table-set-row, .workout-table-step-button, .workout-log-timer
) { background: var(--hp-raised); border-color: var(--hp-border); color: var(--hp-text); }
html[data-color-theme="dark"] .student-theme-ui :is(
  .workout-log-date, .workout-log-timer span, .workout-row-target, .workout-table-field > span,
  .workout-log-exercise-cell p, .workout-log-exercise-cell .workout-log-note,
  .workout-status-action span, .checklist-meta, .set-mini-item-meta
) { color: var(--hp-muted); }
html[data-color-theme="dark"] .student-theme-ui :is(.workout-log-progress, .workout-autosave-status, .workout-log-table-row.is-logged) { background: var(--hp-success-bg); color: var(--hp-success-text); border-color: var(--hp-success-border); }
html[data-color-theme="dark"] .student-theme-ui :is(.workout-log-progress strong, .workout-autosave-status strong) { color: inherit; }
html[data-color-theme="dark"] .student-theme-ui :is(.workout-autosave-status[data-state="error"], .workout-status-button.has-status) { background: var(--hp-warning-bg); color: var(--hp-warning-text); border-color: var(--hp-warning-border); }
html[data-color-theme="dark"] .student-theme-ui .workout-autosave-status[data-state="saving"] { background: var(--hp-neutral-bg); color: var(--hp-neutral-text); }
html[data-color-theme="dark"] .student-theme-ui :is(.workout-info-button, .workout-note-button.has-note) { background: var(--hp-accent-soft); color: var(--hp-accent); border-color: var(--hp-control-border); }
html[data-color-theme="dark"] .student-theme-ui :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea) {
  background: var(--hp-raised); color: var(--hp-text); border-color: var(--hp-control-border); box-shadow: none;
}
html[data-color-theme="dark"] .student-theme-ui :is(input, textarea)::placeholder { color: var(--hp-muted); opacity: 1; }
html[data-color-theme="dark"] .student-theme-ui .workout-table-stepper { border-color: var(--hp-control-border); }
html[data-color-theme="dark"] .student-theme-ui .workout-table-stepper .form-control { background: transparent; border-color: transparent; }
html[data-color-theme="dark"] .student-theme-ui :is(.workout-table-step-button:hover, .workout-row-toggle:hover) { background: var(--hp-accent-soft); color: var(--hp-accent); }
html[data-color-theme="dark"] .student-theme-ui :is(.workout-status-action.is-selected, .workout-status-action:hover) { background: var(--hp-accent-soft); border-color: var(--hp-accent); }
html[data-color-theme="dark"] .student-theme-ui .workout-status-action-danger { color: var(--hp-destructive-text); }
html[data-color-theme="dark"] .student-theme-ui :is(.workout-status-action-danger.is-selected, .workout-status-action-danger:hover) { background: var(--hp-danger-bg); border-color: var(--hp-destructive-text); }

/* Note, guidance, special-status and exit dialogs. */
html[data-color-theme="dark"] .student-theme-ui :is(.attachment-dialog, .attachment-preview, .app-feedback-dialog, .app-feedback-dialog-card) { background: var(--hp-surface); color: var(--hp-text); border-color: var(--hp-border); box-shadow: 0 24px 64px rgba(0, 0, 0, .4); }
html[data-color-theme="dark"] .student-theme-ui :is(.attachment-dialog-head, .attachment-dialog-actions) { background: var(--hp-raised); border-color: var(--hp-border); }
html[data-color-theme="dark"] .student-theme-ui .attachment-modal-backdrop { background: rgba(0, 0, 0, .65); }
html[data-color-theme="dark"] .student-theme-ui :is(.workout-info-dialog-body p, .workout-session-exit-copy, .app-feedback-dialog-message, .app-feedback-dialog-detail) { color: var(--hp-muted); }
html[data-color-theme="dark"] .student-theme-ui :is(.workout-session-exit-action-danger, .workout-session-exit-error, .text-red-700, .errorlist) { color: var(--hp-destructive-text); border-color: var(--hp-destructive-text); }
html[data-color-theme="dark"] .student-theme-ui .workout-session-exit-action small { color: var(--hp-muted); }
html[data-color-theme="dark"] .student-theme-ui :is(.app-feedback-dialog-button-secondary, .app-feedback-dialog-close) { background: var(--hp-raised); color: var(--hp-text); border-color: var(--hp-border); }
html[data-color-theme="dark"] .student-theme-ui .app-feedback-dialog-button-primary { background: var(--hp-accent-fill); color: var(--hp-on-accent); border-color: var(--hp-accent-fill); }

/* Workout-day preview uses the same subdued primary fill. */
html[data-color-theme="dark"] .student-theme-ui :is(.action-card-dark, .workout-focus-card, .workout-day-hero) { background: var(--hp-raised); color: var(--hp-text); border-color: var(--hp-border); box-shadow: none; }
html[data-color-theme="dark"] .student-theme-ui .workout-day-hero::after { background: none; }
html[data-color-theme="dark"] .student-theme-ui :is(.workout-day-hero-kicker, .workout-day-hero-meta span, .workout-day-hero-secondary) { background: var(--hp-neutral-bg); color: var(--hp-neutral-text); border-color: var(--hp-border); }
html[data-color-theme="dark"] .student-theme-ui .workout-day-hero-primary { background: var(--hp-accent-fill); color: var(--hp-on-accent); box-shadow: none; }
html[data-color-theme="dark"] .student-theme-ui .workout-day-hero-primary:hover { background: var(--hp-accent-fill-hover); color: var(--hp-on-accent); }
html[data-color-theme="dark"] .student-theme-ui :is(.workout-day-hero-text, .workout-day-hero-action-note) { color: var(--hp-muted); opacity: 1; }
html[data-color-theme="dark"] .student-theme-ui .workout-day-hero-primary .workout-day-hero-action-note { color: var(--hp-on-accent); }

/* Keep every desktop navigation link visible before the mobile breakpoint. */
@media (min-width: 760px) and (max-width: 1023px) {
  .student-theme-ui .desktop-nav a { padding-inline: 4px; font-size: 12px; }
}

/* Keep set controls inside their row on narrow phones in either theme. */
@media (max-width: 380px) {
  .student-theme-ui .workout-table-set-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .student-theme-ui .workout-table-set-rir { grid-column: 1 / -1; }
}
