/* Participant colors follow the site preference; workspace geometry stays independent. */
body.participant-workspace {
  --bg: var(--theme-bg);
  --panel: var(--theme-panel);
  --panel2: var(--theme-panel2);
  --line: var(--theme-line);
  --text: var(--theme-text);
  --muted: var(--theme-muted);
  --mint: var(--theme-success-text);
  --amber: var(--theme-warning-text);
  --red: var(--theme-danger-text);
  --lime: var(--theme-accent);
  --brand-red: inherit;
  --brand-red-hover: inherit;
  --workspace-total: var(--theme-total);
  --workspace-cpu: var(--theme-cpu);
  --workspace-gpu: var(--theme-gpu);
  color-scheme: inherit;
}
body.participant-workspace .sandbox { border-color: var(--theme-line); }
body.participant-workspace .sandbox strong { color: var(--theme-text); }
body.participant-workspace ::selection { background: var(--theme-selected); color: var(--theme-text); }
body.participant-workspace :is(button,a,input,select,textarea,summary):focus-visible { outline-color: var(--theme-accent); }
body.participant-workspace .app-bottom-nav { background: var(--theme-panel); border-color: var(--theme-line); }
body.participant-workspace .app-bottom-nav > :is(a,button):hover { background: var(--theme-panel2); }
body.participant-workspace .app-bottom-nav .selected { color: var(--theme-accent); }
body.participant-workspace .app-create-icon { background: var(--brand-red); border-color: var(--brand-red); }
body.participant-workspace .nav .app-header-title { color: #c9c9d5; }
body.participant-workspace .nav .app-account-button { color: var(--theme-text); }
body.participant-workspace .nav .app-account-button { background: var(--theme-panel2); border-color: var(--theme-border); }

#participantWorkspace :is(label,.form-grid label,.check) { color: var(--theme-text) !important; }
#participantWorkspace :is(.accent,.participant-section-heading .eyebrow,.participant-guest .eyebrow) { color: var(--theme-accent); }
#participantWorkspace :is(input:not([type=checkbox]):not([type=range]),textarea,select) { background: var(--theme-input); border-color: var(--theme-border); color: var(--theme-text); }
#participantWorkspace input:is([type=checkbox],[type=range]) { accent-color: var(--brand-red); }
#participantWorkspace .btn.secondary { background: var(--theme-panel2); color: var(--theme-text); border-color: var(--theme-border); }
#participantWorkspace .btn.ghost { color: var(--theme-text); border-color: var(--theme-border); }
#participantWorkspace :is(.btn.secondary,.btn.ghost):hover { background: var(--theme-selected); color: var(--theme-text); border-color: var(--theme-selected-border); }
#participantWorkspace .btn.danger { background: var(--theme-danger-bg); color: var(--theme-danger-text); border-color: var(--theme-danger-border); }
#participantWorkspace :is(.notice,.empty) { background: var(--theme-panel2); color: var(--theme-text); border-color: var(--theme-border); }
#participantWorkspace .notice.green { background: var(--theme-success-bg); color: var(--theme-success-text); border-color: var(--theme-success-border); }
#participantWorkspace .notice.red { background: var(--theme-danger-bg); color: var(--theme-danger-text); border-color: var(--theme-danger-border); }
#participantWorkspace .badge { background: var(--theme-success-bg); color: var(--theme-success-text); }
#participantWorkspace .badge.neutral { background: var(--theme-panel2); color: var(--theme-muted); }
#participantWorkspace .badge.warn { background: var(--theme-warning-bg); color: var(--theme-warning-text); }
#participantWorkspace .error { color: var(--theme-danger-text); }
#participantWorkspace :is(.mono,.definition,.definition dt,.back,.participant-back,.participant-entry-total,.participant-kicker) { color: var(--theme-muted); }
#participantWorkspace :is(.definition dd,.entry-quantity,.participant-back:hover) { color: var(--theme-text); }
#participantWorkspace .inline-code { background: var(--theme-input); color: var(--theme-text); }
#participantWorkspace .participant-nav > :is(button,a) { color: var(--theme-muted); }
#participantWorkspace .participant-nav > :is(button,a):hover { background: var(--theme-panel2); color: var(--theme-text); }
#participantWorkspace .participant-nav > :is([aria-selected=true],[aria-current=page],.selected) { color: var(--theme-text); }
#participantWorkspace .participant-nav > :is([aria-selected=true],[aria-current=page],.selected)::after { background: var(--brand-red); }
#participantWorkspace .participant-nav :is(.participant-count,.participant-nav-count) { background: var(--theme-panel2); color: var(--theme-text); }
#participantWorkspace .participant-entry-task { background: var(--theme-panel); }
#participantWorkspace .participant-guest-symbol { background: var(--theme-selected); border-color: var(--theme-selected-border); color: var(--theme-accent); }

/* Reward, entry options and campaign details. */
#participantWorkspace .campaign-compact { background: var(--theme-panel); }
#participantWorkspace :is(.campaign-share,.campaign-quick-actions .campaign-header-rules) { background: var(--theme-panel2); border-color: var(--theme-border); color: var(--theme-text); }
#participantWorkspace :is(.campaign-share,.campaign-header-rules):hover { background: var(--theme-selected); color: var(--theme-text); }
#participantWorkspace .campaign-offer .campaign-cover { background: var(--theme-input); }
#participantWorkspace :is(.campaign-cover .campaign-cover-label,.campaign-compact .engagement-prize .panel-label,.campaign-compact .big-prize .usd-estimate,.campaign-invitation,.campaign-compact > .engagement-summary,.campaign-facts,.campaign-method-heading > span,.campaign-method-copy small,.campaign-compact .campaign-entry-note,.campaign-compact .engagement-eligibility,.engagement-description p,.campaign-return) { color: var(--theme-muted); }
#participantWorkspace :is(.campaign-purpose,.campaign-method-button > .icon) { color: var(--theme-accent); }
#participantWorkspace :is(.campaign-compact .big-prize,.campaign-compact .big-prize small,.campaign-facts strong,.campaign-method-copy strong,.engagement-description summary,.entry-summary .ticket-count,.campaign-details-panel > details > summary) { color: var(--theme-text); }
#participantWorkspace .campaign-progress { background: var(--theme-line); }
#participantWorkspace .campaign-progress > span { background: var(--brand-red); }
#participantWorkspace .campaign-method-button { background: var(--theme-panel2); border-color: var(--theme-border); color: var(--theme-text); }
#participantWorkspace .campaign-method-button:hover { background: var(--theme-selected); border-color: var(--theme-selected-border); }
#participantWorkspace .campaign-method-button.selected { background: var(--theme-selected); border-color: var(--theme-selected-border); }
#participantWorkspace .campaign-method-button:disabled { background: var(--theme-panel2); border-color: var(--theme-line); }
#participantWorkspace .campaign-method-icon { background: var(--theme-selected); color: var(--theme-accent); }
#participantWorkspace .campaign-owner-actions { background: var(--theme-selected); border-color: var(--theme-selected-border); }
#participantWorkspace .campaign-rules-trigger:hover { background: var(--theme-selected); color: var(--theme-accent); }

/* A shared scale and semantic chart colors remain distinct in both modes. */
#participantWorkspace :is(.mining-eyebrow,.mining-console-credit-label,.mining-live-rates span,.mining-live-rates small,.mining-rate-heading h3,.mining-rate-heading small,.mining-rate-heading span,.mining-output-total > span,.mining-output-legend > div,.mining-output-legend > span,.mining-output-legend > button,.mining-rate-axis,.mining-rate-scale,#miningRateEmpty,#miningRateSummary) { color: var(--theme-muted); }
#participantWorkspace .mining-console-nav { background: transparent; border-color: var(--theme-line); padding: 0; border-radius: 0; }
#participantWorkspace .mining-console-nav button { position: relative; color: var(--theme-muted); border-radius: 0; }
#participantWorkspace .mining-console-nav button:hover { background: var(--theme-selected); color: var(--theme-text); }
#participantWorkspace .mining-console-nav button:is([aria-selected=true],[aria-current=page],.selected) { background: transparent; color: var(--theme-text); box-shadow: none; }
#participantWorkspace .mining-console-nav button[aria-selected=true]::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 0; height: 2px; background: var(--theme-accent); }
#participantWorkspace .mining-engine-grid { background: var(--theme-panel); border-color: var(--theme-line); }
#participantWorkspace .mining-engine-instrument { background: var(--theme-panel2); border-color: var(--theme-line); }
#participantWorkspace .mining-output-plot #miningRateEmpty { color: var(--theme-muted); background: var(--theme-panel); }
#participantWorkspace .mining-income-chart .mining-rate-grid { stroke: var(--theme-line); }
#participantWorkspace .mining-income-chart circle { stroke: var(--theme-panel); }
#participantWorkspace .mining-eta-track { stroke: var(--theme-line); }
#participantWorkspace .mining-eta-confirmed { stroke: var(--theme-accent); }
#participantWorkspace .mining-eta-pending { stroke: var(--theme-warning-text); }
#participantWorkspace :is(.mining-eta-center span,.mining-eta-center small,.mining-eta-caption,.mining-eta-caption > span,.mining-eta-caption p,.mining-eta-caption small) { color: var(--theme-muted); }
#participantWorkspace :is(.mining-eta-center #workEta,.mining-eta-caption strong) { color: var(--theme-text); }
#participantWorkspace #miningEtaPending { color: var(--theme-warning-text); }
#participantWorkspace .mining-preset label { color: var(--theme-text); }
#participantWorkspace .mining-preset select { background: var(--theme-input); }
#participantWorkspace :is(#workStatus,#gpuRunStatus) { color: var(--theme-text); }
#participantWorkspace :is(.mining-start-note,.mining-behavior-summary,.mining-verified-progress > span:last-child) { color: var(--theme-muted); }

/* Settings and recorded diagnostics use the same readable surfaces as Engine. */
#participantWorkspace .mining-settings-grid { background: var(--theme-panel); }
#participantWorkspace .mining-device-badge { background: var(--theme-selected); color: var(--theme-accent); }
#participantWorkspace .mining-advanced-toggle { background: var(--theme-panel2); color: var(--theme-text); border-color: var(--theme-border); }
#participantWorkspace .mining-advanced-toggle:hover { background: var(--theme-selected); color: var(--theme-text); }
#participantWorkspace .mining-advanced-toggle[aria-checked=true] { background: var(--theme-selected); border-color: var(--theme-selected-border); color: var(--theme-accent); }
#participantWorkspace .mining-toggle-track { background: var(--theme-muted); }
#participantWorkspace .mining-advanced-toggle[aria-checked=true] .mining-toggle-track { background: var(--brand-red); }
#participantWorkspace .mining-screen-wake[data-status=active] #screenWakeStatus { color: var(--theme-success-text); }
#participantWorkspace .mining-screen-wake:is([data-status=unavailable],[data-status=released]) #screenWakeStatus { color: var(--theme-warning-text); }
#participantWorkspace .mining-thread-scroll { background: var(--theme-panel); }
#participantWorkspace :is(th,td) { border-color: var(--theme-line); color: var(--theme-text); }
#participantWorkspace th { color: var(--theme-muted); }
#participantWorkspace .mining-thread-panel :is(summary,h3) { color: var(--theme-text); }
#participantWorkspace :is(.stat-mini,.mining-stat) { background: var(--theme-panel2); border-color: var(--theme-line); color: var(--theme-muted); }
#participantWorkspace .stat-mini strong { color: var(--theme-text); }
#participantWorkspace :is(.mining-stat-label,.mining-stat-detail) { color: var(--theme-muted); }
#participantWorkspace #miningCreditPercent { color: var(--theme-accent); }
#participantWorkspace .mining-entry-amount strong { color: var(--theme-text); }
#participantWorkspace :is(.mining-entry-target,.mining-entry-status,.mining-entry-amount > span,.mining-credit-sources-heading,.mining-credit-sources small,.mining-credit-history strong,.mining-credit-history p,.mining-credit-history dl > div,#workEtaDetail,#miningCreditDetailStatus,.mining-credit-note) { color: var(--theme-muted); }
#participantWorkspace .mining-credit-meter { background: var(--theme-line); }
#participantWorkspace #miningCreditConfirmedFill { background: var(--brand-red); }
#participantWorkspace #miningCreditPendingFill { background: repeating-linear-gradient(135deg,var(--theme-warning-text) 0,var(--theme-warning-text) 3px,var(--theme-warning-bg) 3px,var(--theme-warning-bg) 6px); }
#participantWorkspace .mining-credit-sources > div { border-color: var(--theme-line); }
#participantWorkspace .mining-credit-sources :is(dt,dd) { color: var(--theme-text); }
#participantWorkspace .mining-credit-sources :is(.mining-credit-warning,.mining-source-pending) { color: var(--theme-warning-text); }

/* Existing dialogs keep their behavior and receive the same selected palette. */
body.participant-workspace #dialog { color: var(--theme-text); background: var(--theme-panel); border-color: var(--theme-border); }
body.participant-workspace #dialog .dialog-head { background: var(--theme-panel); border-color: var(--theme-line); }
body.participant-workspace #dialog :is(h2,h3,h4,strong,summary,label) { color: var(--theme-text); }
body.participant-workspace #dialog :is(p,small,.hint,.small,.check) { color: var(--theme-muted) !important; }
body.participant-workspace #dialog :is(input,select,textarea) { background: var(--theme-input); color: var(--theme-text); border-color: var(--theme-border); }
body.participant-workspace #dialog .close { background: var(--theme-panel2); color: var(--theme-text); }
body.participant-workspace #dialog .btn.ghost { color: var(--theme-text); border-color: var(--theme-border); }
body.participant-workspace #dialog .btn.secondary { color: var(--theme-text); background: var(--theme-panel2); border-color: var(--theme-border); }
body.participant-workspace #dialog .notice { color: var(--theme-warning-text); background: var(--theme-warning-bg); border-color: var(--theme-warning-border); }
body.participant-workspace #dialog .notice.green { color: var(--theme-success-text); background: var(--theme-success-bg); border-color: var(--theme-success-border); }
body.participant-workspace #dialog .notice.red { color: var(--theme-danger-text); background: var(--theme-danger-bg); border-color: var(--theme-danger-border); }
body.participant-workspace #dialog :is(.rules-card,.rules-pool-calculation,.rules-summary,.rules-section,.join-disclosure-return) { background: var(--theme-panel2); border-color: var(--theme-border); color: var(--theme-text); }
body.participant-workspace #dialog :is(.definition dt,.definition dd) { color: var(--theme-muted); }
body.participant-workspace #dialog.is-campaign-rules .dialog-body { background: var(--theme-panel); }
body.participant-workspace #dialog .campaign-rules-modal { --rules-ink: var(--theme-text); --rules-red: var(--theme-accent); --rules-muted: var(--theme-muted); --rules-line: var(--theme-border); }
body.participant-workspace #dialog .rules-section { background: transparent; }
body.participant-workspace #dialog :is(.rules-reward,.rules-method,.rules-fact-grid,.rules-explainer,.rules-draw-steps,.rules-full) { background: var(--theme-panel2); border-color: var(--theme-border); }
body.participant-workspace #dialog :is(.rules-age-stamp,.rules-explainer-icon) { background: var(--theme-selected); border-color: var(--theme-selected-border); outline-color: var(--theme-selected-border); }
body.participant-workspace #dialog .rules-age-stamp strong { color: var(--theme-accent); }
body.participant-workspace #dialog .rules-money-note { background: var(--theme-warning-bg); border-color: var(--theme-warning-border); }
body.participant-workspace #dialog .rules-kicker { color: var(--theme-muted); }
body.participant-workspace #dialog .rules-hero .rules-kicker { color: var(--theme-accent); }
body.participant-workspace #dialog :is(.rules-draw-steps>li+li,.rules-method .rules-small) { border-color: var(--theme-border); }
body.participant-workspace #dialog .rules-draw-steps>li>span { color: var(--theme-muted); border-color: var(--theme-border); }
body.participant-workspace #dialog .rules-status strong { color: var(--theme-success-text); }
body.participant-workspace #dialog :is(.rules-status--paused,.rules-status--waiting) strong { color: var(--theme-warning-text); }
body.participant-workspace #dialog .rules-status--closed strong { color: var(--theme-muted); }
body.participant-workspace #dialog .enrollment-reassurance { background: var(--theme-panel2); color: var(--theme-muted) !important; }
body.participant-workspace #dialog :is(.enrollment-optional,.wallet-help) { border-color: var(--theme-line); }

@media(max-width:1023px) {
  #participantWorkspace[data-screen=mining][data-panel=engine] .mining-actions { background: var(--theme-panel2); border-color: var(--theme-border); box-shadow: 0 -8px 30px #0002; }
  #participantWorkspace[data-screen=mining][data-panel=engine] .mining-action-disclosure { color: var(--theme-muted); }
}
/* Small telemetry labels keep the same readable contrast as body copy. */
#participantWorkspace :is(.mining-device-unavailable,.mining-activity-strip span,.mining-entry-amount>div>span) { color:var(--theme-muted); }
#participantWorkspace .mining-entry-usd>div>span { color:var(--theme-muted); }

/* Legacy metric labels use the shared readable secondary-text color. */
#participantWorkspace .mining-device-unavailable,
#participantWorkspace .mining-activity-strip span,
#participantWorkspace .mining-entry-amount > div > span { color: var(--theme-muted); }

/* The draw timeline communicates state through labels as well as color. */
#participantWorkspace .draw-progress-heading .eyebrow { color: var(--theme-accent); }
#participantWorkspace :is(.draw-progress-summary,.draw-progress-note,.draw-progress-checked,.draw-progress-metrics dt,.draw-progress-metrics small) { color: var(--theme-muted); }
#participantWorkspace .draw-progress-metrics dd { color: var(--theme-text); }
#participantWorkspace .draw-progress-steps > li > span { color: var(--theme-muted); background: var(--theme-panel2); border-color: var(--theme-border); }
#participantWorkspace .draw-progress-steps > li[data-step-state=waiting] strong { color: var(--theme-muted); }
#participantWorkspace .draw-progress-steps > li[data-step-state=current] { border-bottom-color: var(--theme-accent); }
#participantWorkspace .draw-progress-steps > li[data-step-state=current] > span { color: var(--theme-accent); background: var(--theme-selected); border-color: var(--theme-selected-border); }
#participantWorkspace .draw-progress-steps > li[data-step-state=complete] { border-bottom-color: var(--theme-success-text); }
#participantWorkspace .draw-progress-steps > li[data-step-state=complete] > span { color: var(--theme-success-text); background: var(--theme-success-bg); border-color: var(--theme-success-border); }
