/*
 * Dinokana Youth Development — Obsidian Black + Nunito, whole-platform local trial.
 * Version: 2026-10-26 / first unified pass.
 * Single established dyd-global-appearance-v1 preference. No new storage or JS.
 * Keep meaningful status colours, logo images, maps, graphs and print records intact.
 * Admin Command Centre retains its separately reviewed Obsidian stylesheet.
 */

/* One coherent Nunito identity in light and dark modes. Do not override icon fonts. */
body, body :is(h1,h2,h3,h4,h5,h6,p,span,small,strong,b,em,a,button,label,summary,input,select,textarea,dt,dd,th,td,figcaption,legend,li) {
  font-family: 'Nunito', system-ui, sans-serif !important;
}
body :is(h1,h2,h3,h4,h5,h6) { font-weight: 800; }

/* Theme palette: this is deliberately graphite/black, never green canvas. */
html[data-dyd-global-theme="dark"] {
  color-scheme: dark;
  --dyo-bg: #08090d;
  --dyo-surface: #171b22;
  --dyo-surface-high: #222731;
  --dyo-surface-soft: #1d232c;
  --dyo-line: #39424e;
  --dyo-text: #f3f5fa;
  --dyo-muted: #b8c2cf;
  --dyo-cyan: #76dce8;
  --dyo-mint: #8be7c2;
  --dyo-gold: #f3bd62;
  --dyo-shadow: 0 17px 40px rgba(0, 0, 0, .35), inset 0 1px rgba(255,255,255,.04);
}
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark) {
  --background: var(--dyo-bg);
  --card: var(--dyo-surface);
  --text: var(--dyo-text);
  --primary: var(--dyo-mint);
  --secondary: var(--dyo-cyan);
  --shadow: var(--dyo-shadow);
  background: radial-gradient(circle at 94% 5%, rgba(72,113,140,.09), transparent 34rem), #08090d !important;
  color: var(--dyo-text) !important;
}

/* Shared shell across home, operations, accounts and the activity brief. */
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark) .app-brandbar {
  background: #0c0e13 !important;
  border-bottom: 1px solid #272e37 !important;
  box-shadow: 0 7px 18px rgba(0,0,0,.34) !important;
}
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark) :is(.app-brand-home,.app-brand-name) { color: #f6f8fb !important; }
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark) :is(.app-brand-tagline,.app-user-context > span) { color: #abb6c5 !important; }
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark) .app-user-context :is(a,strong,.app-logout-button) {
  background: #1c222b !important;
  border: 1px solid #404956 !important;
  color: #f2f5f9 !important;
}
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark) .branded-site-footer {
  background: #0c0f14 !important; border-color: #2b313c !important;
  color: #b4bfcd !important;
}
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark) .branded-site-footer :is(p,span,.footer-copyright) { color: #b4bfcd !important; }
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark) .privacy-footer-notice {
  background: #1b222b !important; border-color: #414956 !important;
}
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark) .privacy-footer-notice :is(summary,p) { color: #d6e2e8 !important; }
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark) :is(.back-link,.form-kicker) { color: #80dbeb !important; }

/* Theme selectors are shared with the original dashboard/operations controllers. */
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark) :is(.dashboard-home-theme-switch,.dyd-ops-switch) {
  color: #e7ebf1 !important;
  background: #1a2029 !important;
  border-color: #46515f !important;
  box-shadow: 0 9px 22px rgba(0,0,0,.26) !important;
}
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark) :is(.dashboard-home-theme-switch,.dyd-ops-switch) button[aria-pressed="true"] {
  background: #92e9ce !important; color: #0d1920 !important; border-color: #b0f1de !important;
}

/* HOME: black canvas, lifted graphite cards, DYD accent rails. */
html[data-dyd-global-theme="dark"] body.dashboard-body .dashboard-hero {
  background: radial-gradient(circle at 89% 18%, rgba(40,100,125,.18), transparent 39%),
              linear-gradient(125deg, #1d222b, #11141b 65%, #181e29) !important;
  border: 1px solid #424c59 !important;
  box-shadow: 0 28px 58px rgba(0,0,0,.44), inset 0 1px rgba(255,255,255,.07) !important;
}
html[data-dyd-global-theme="dark"] body.dashboard-body .dashboard-hero::before {
  border-color: rgba(179,190,205,.13) !important;
}
html[data-dyd-global-theme="dark"] body.dashboard-body :is(.dashboard-hero h1,.dashboard-section-heading h2) { color: #f4f7fb !important; }
html[data-dyd-global-theme="dark"] body.dashboard-body :is(.dashboard-hero-copy > p,.dashboard-section-heading > p) { color: #c0cad5 !important; }
html[data-dyd-global-theme="dark"] body.dashboard-body .dashboard-eyebrow { color: #85dfea !important; }
html[data-dyd-global-theme="dark"] body.dashboard-body .dashboard-hero-meta span {
  background: #262e38 !important; border: 1px solid #485566 !important; color: #d9e4e9 !important;
}
html[data-dyd-global-theme="dark"] body.dashboard-body :is(
  .dashboard-card-grid-primary > .dashboard-card,
  .dashboard-card-grid-secondary > .dashboard-card,
  .dashboard-card-grid-recognition .dashboard-card
) {
  color: #f4f7fa !important;
  background: linear-gradient(148deg, #20252e, #151820) !important;
  border: 1px solid #434b58 !important;
  border-top: 4px solid var(--home-accent,#68d7de) !important;
  box-shadow: var(--dyo-shadow) !important;
}
html[data-dyd-global-theme="dark"] body.dashboard-body .dashboard-card:hover {
  border-color: #7adfd4 !important;
  box-shadow: 0 24px 45px rgba(0,0,0,.47) !important;
}
html[data-dyd-global-theme="dark"] body.dashboard-body .dashboard-card-copy :is(strong,span) { color: #f0f3f8 !important; }
html[data-dyd-global-theme="dark"] body.dashboard-body .dashboard-card-copy small { color: #8ee7e3 !important; }
html[data-dyd-global-theme="dark"] body.dashboard-body :is(.dashboard-card-icon,.dashboard-card-arrow) {
  background: #28333b !important; border-color: #456171 !important; color: #a0f0dc !important;
}
html[data-dyd-global-theme="dark"] body.dashboard-body :is(.recognition-home-levels,.recognition-home-accent) { color: #8fe4e9 !important; }
html[data-dyd-global-theme="dark"] body.dashboard-body .dashboard-card-warning {
  background: linear-gradient(140deg,#2e2723,#1b1e23) !important;
  border-top-color: #efba62 !important;
}
/* Preserve the white DYD-logo panel: the official coloured logo needs its neutral background. */
html[data-dyd-global-theme="dark"] body.dashboard-body .dashboard-logo-panel { background: #fff !important; }

/* MANAGE ACTIVITIES: meaningful workflow accents, but cards have graphite bases. */
html[data-dyd-global-theme="dark"] body.dyd-ops-page :is(.manage-v2-hero,.manage-v2-workflow,.manage-v2-history,.manage-v2-journey,.manage-v2-empty) {
  background: linear-gradient(137deg, #202630, #151920) !important;
  color: #f1f4f8 !important;
  border-color: #46515e !important;
  box-shadow: var(--dyo-shadow) !important;
}
html[data-dyd-global-theme="dark"] body.dyd-ops-page .manage-v2-hero {
  background: radial-gradient(circle at 97% 10%,rgba(32,111,135,.18),transparent 45%),linear-gradient(125deg,#242933,#151920) !important;
}
html[data-dyd-global-theme="dark"] body.dyd-ops-page .manage-v2-hero-stats > div {
  background: #151b24 !important; border-color: #3d5261 !important; border-top-color: #76dae6 !important;
}
html[data-dyd-global-theme="dark"] body.dyd-ops-page :is(.manage-v2-hero-stats strong,.manage-v2-card-body h3,.manage-v2-history-main > strong,.manage-v2-workflow-heading h2,.manage-v2-section-heading h2,.manage-v2-records-toolbar h2) { color: #f3f5fa !important; }
html[data-dyd-global-theme="dark"] body.dyd-ops-page :is(.manage-v2-hero p,.manage-v2-card-meta,.manage-v2-history-id,.manage-v2-history-main > small,.manage-v2-section-heading p) { color: #bac5d0 !important; }
html[data-dyd-global-theme="dark"] body.dyd-ops-page .manage-v2-activity-card {
  background: linear-gradient(135deg,#222831,#161a22) !important;
  border: 1px solid #434d59 !important; border-top: 4px solid var(--programme-accent,#74d8de) !important;
  box-shadow: 0 17px 40px rgba(0,0,0,.4) !important;
}
html[data-dyd-global-theme="dark"] body.dyd-ops-page .manage-v2-activity-card:hover { border-color: #76d9ce !important; }
html[data-dyd-global-theme="dark"] body.dyd-ops-page .manage-v2-next-action { border-top-color: #444e58 !important; }
html[data-dyd-global-theme="dark"] body.dyd-ops-page .manage-v2-history-card {
  background: #222733 !important; border-color: #45505d !important;
  border-left-color: var(--programme-accent, #80d9cb) !important;
}
html[data-dyd-global-theme="dark"] body.dyd-ops-page .manage-v2-history[open] > summary { background: #292d37 !important; }
html[data-dyd-global-theme="dark"] body.dyd-ops-page .manage-v2-workflow-chip[data-workflow-stage="needs-setup"] { background: #263241 !important; border-color: #65798d !important; }
html[data-dyd-global-theme="dark"] body.dyd-ops-page .manage-v2-workflow-chip[data-workflow-stage="attendance"] { background: #192c3d !important; border-color: #537a94 !important; }
html[data-dyd-global-theme="dark"] body.dyd-ops-page .manage-v2-workflow-chip[data-workflow-stage="fieldwork-reporting"] { background: #423025 !important; border-color: #966d4a !important; }
html[data-dyd-global-theme="dark"] body.dyd-ops-page .manage-v2-workflow-chip[data-workflow-stage="completed"] { background: #1c3c31 !important; border-color: #4c9574 !important; }
html[data-dyd-global-theme="dark"] body.dyd-ops-page :is(.manage-v2-journey-steps span,.manage-v2-count-badge) { background: #293744 !important; border-color: #4c7580 !important; color: #ddf7f6 !important; }

/* Open-Meteo: exact hourly wording/attribution; visual styling only. */
html[data-dyd-global-theme="dark"] body.dyd-ops-page :is(.manage-weather-strip,.weather-forecast-card,.weather-forecast-hero,.dyd-weather-hourly-strip) {
  background: linear-gradient(130deg,#222934,#171e26) !important;
  border-color: #455664 !important;
  box-shadow: 0 11px 28px rgba(0,0,0,.26) !important;
}
html[data-dyd-global-theme="dark"] body.dyd-ops-page :is(.dyd-hourly-item,.dyd-detail-hourly .dyd-hourly-item) {
  background: #2a313d !important; border-color: #526272 !important;
}
html[data-dyd-global-theme="dark"] body.dyd-ops-page :is(.manage-weather-condition > strong,.manage-weather-temperature > strong,.manage-weather-metrics strong,.dyd-hourly-label,.dyd-hourly-heading strong) { color:#f5f7fb !important; }
html[data-dyd-global-theme="dark"] body.dyd-ops-page :is(.manage-weather-condition > small,.manage-weather-temperature > small,.manage-weather-metrics,.manage-weather-area,.dyd-hourly-heading span,.dyd-weather-credit) { color: #b9c4d2 !important; }
html[data-dyd-global-theme="dark"] body.dyd-ops-page :is(.dyd-hourly-item time,.dyd-weather-credit a,.weather-source-row a) { color: #8ce8ef !important; }

/* Activity detail, volunteers, fieldwork, attendance, reports, administration forms. */
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark) :is(
  .volunteer-list-section,.attendance-hub-list-section,.attendance-workload-section,
  .historical-section,.historical-empty-state,.attendance-guide-disclosure,
  .service-disclosure,.service-rehearsals,.service-table-wrap,
  .impact-hero,.programme-panel,.programme-section,.programme-tabs,
  .impact-v2-participation-summary,.impact-v2-trust,.impact-v2-activity-results > div,
  .impact-v2-programmes,.impact-v2-latest,.impact-v2-attendance,.impact-v2-progress,
  .impact-v2-participation,.impact-v2-participation-story,
  .activity-hero,.activity-panel,.activity-tabs,.activity-next-step,.activity-summary,
  .directory-hero,.activity-directory-card,.assignment-card,.form-card,.card,
  .volunteer-card,.profile-card,.directory-stat,.attendance-panel,.attendance-method-panel,
  .attendance-group-panel,.attendance-guide-card,.attendance-registered-walkin,
  .attendance-hub-hero,.attendance-hub-card,.attendance-scanner-panel,.attendance-scanner-hero,
  .fieldwork-primary-card,.fieldwork-live-card,.fieldwork-complete-card,.fieldwork-status-box,
  .report-form-section,.report-evidence-manager,.report-narrative-section,
  .meeting-card,.compact-panel,.admin-user-panel,.admin-audit-v2-panel,
  .admin-foundation-panel,.admin-metric-card,.historical-record-card,
  .historical-evidence-panel,.historical-action-card,.impact-v2-panel,
  .impact-v2-programme-card,.impact-v2-activity-card,.impact-v2-hero,
  .service-stat,.service-volunteer-card,.service-how-hours,.service-award-tier,
  .service-empty-state,.service-volunteer-profile,.service-hours-hero
) {
  background: var(--dyo-surface) !important;
  border-color: #404955 !important;
  color: #f0f3f8 !important;
  box-shadow: var(--dyo-shadow) !important;
}
/* Avoid converting status-specific coloured rows/chips into neutral grey. */
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark) :is(
  .activity-detail-grid,.activity-detail-grid > div,.activity-notes,
  .fieldwork-live-details > div,.fieldwork-complete-grid > div,
  .admin-audit-v2-row,.admin-user-row,.report-evidence-row,.report-evidence-upload-row,
  .summary-card:not(.attendance-metric),.attendance-row,.attendance-team-communication,
  .attendance-status-guide,.attendance-recorded-state,.service-card-highlight,
  .impact-v2-highlight,.impact-v2-hero-facts > div,.impact-v2-participation-summary > div,
  .impact-v2-activity-outcome,.programme-header,.story-card,.dream-panel,
  .service-stat-inner,.service-volunteer-summary,.attendance-method-card,
  .fieldwork-weather-snapshot,.weather-metric-tile
) { background: var(--dyo-surface-high) !important; border-color: var(--dyo-line) !important; color:var(--dyo-text) !important; }
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark) :is(
  .activity-hero h1,.activity-panel h2,.activity-panel h3,.form-heading h1,.form-card h2,
  .volunteer-page h1,.volunteer-page h2,.directory-hero h1,.panel-heading h2,
  .attendance-hub-hero h1,.fieldwork-hero h1,.admin-audit-v2 h1,
  .service-hours-page h1,.service-hours-page h2,.service-hours-page h3,
  .impact-v2 h1,.impact-v2 h2,.meeting-card h2,
  .section-heading-row h2,.historical-section-heading h2,.historical-record-card h3,
  .volunteer-card-content h3,.service-card-identity h3 a,.service-card-highlight strong,
  .service-stat strong,.service-disclosure > summary,.service-milestone strong,
  .impact-v2-section-intro h2,.impact-v2-hero h1,.impact-v2-highlight-value,
  .impact-v2-programme-name,.impact-v2-participation-number,.impact-v2-latest h2,
  .impact-v2-activity-card h3,.impact-v2-attendance h2,.impact-v2-progress h2,
  .impact-hero h1,.programme-header h2,.programme-section h3,.story-card strong,
  .attendance-person strong,.summary-card:not(.attendance-metric) strong,
  .attendance-hub-card-main h3,.attendance-hub-counts strong,.volunteer-card-section strong,
  .impact-v2-hero-facts strong,.impact-v2-participation-summary strong,
  .impact-v2-programme-feature :is(strong,span),.impact-v2-programme-empty strong,
  .impact-v2-activity-results strong
) { color: #f2f5fa !important; }
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark) :is(
  .form-heading p,.activity-meta-row,.activity-id-small,.volunteer-card-meta,
  .attendance-hub-meta,.directory-stat span,.activity-detail-grid dt,
  .fieldwork-live-details dt,.report-kpi-grid span,.service-hours-footnote,
  .service-volunteer-card small,.impact-v2-trust,.meeting-card small,
  .section-supporting-text,.historical-empty-state p,.historical-record-card p,
  .service-card-highlight span,.service-preview-milestone,.service-milestone label,
  .service-stat span,.service-stat small,.service-detail-figures dt,
  .service-table small,.service-hours-heading p,.service-explainer,
  .service-how-hours p,.service-award-tier span,.service-disclosure > summary span,
  .impact-v2-lead,.impact-v2-hero-facts,.impact-v2-highlight-label,
  .impact-v2-section-intro p,.impact-v2-participation-summary,.impact-v2-programme-details,
  .impact-v2-programme-empty,.impact-v2-no-records,.impact-v2-activity-id,
  .impact-v2-activity-outcome span,.impact-v2-participation-story p,
  .programme-section-intro,.programme-header p,.impact-hero p,.story-card p,
  .dream-panel p,.attendance-method-footnote,.attendance-person span,
  .directory-hero p,.volunteer-card-meta strong,.volunteer-card-section-missing,
  .attendance-workload-heading p,.attendance-hub-counts span,
  .admin-metric-card :is(span,small),.historical-section-heading p,
  .service-award-tier small,.impact-v2-date-pill strong,.impact-v2-hero-facts span,
  .impact-v2-attendance-heading span,.impact-v2-participation-summary span,
  .impact-v2-programme-empty p,.impact-v2-activity-header p,.impact-v2-activity-results span,
  .impact-v2-trust p,.activity-fieldwork-evidence-heading p,.fieldwork-map-details dt
) { color: #b7c3d0 !important; }
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark) :is(
  .activity-detail-grid dd,.report-kpi-grid strong,.directory-stat strong,
  .service-volunteer-card strong,.fieldwork-live-details dd
) { color: #f0f4f8 !important; }

/* Make forms legible. Do not override Present/Late/Absent/Excused visual semantics. */
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark) :is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="range"]),
  select,textarea
) {
  background: #1d232d !important;
  border-color: #5a6574 !important;
  color: #f4f7fa !important;
  color-scheme: dark;
}
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark) :is(input,textarea)::placeholder { color: #aebac8 !important; opacity: 1; }
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark) :is(label,.form-label,.form-group label) { color: #e2e9ef !important; }
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark) :is(input,select,textarea,button,a,summary):focus-visible {
  outline: 3px solid #77e0e9 !important; outline-offset: 3px;
}
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark) :is(.button-secondary,.form-actions .button-secondary) {
  background: #2b3340 !important; border-color: #536272 !important; color: #eff4f8 !important;
}
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark) :is(.button-primary,.manage-v2-action-button) {
  background: #85e6bc !important; border-color: #91edc9 !important; color:#101b20 !important;
}
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark) :is(table, .ab-table) { border-color: #49515f !important; }
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark) :is(th,thead) {
  background: #303947 !important; color:#f3f5f9 !important; border-color: #525e6e !important;
}
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark) :is(td,tbody tr) { border-color: #414b59 !important; }
/* Named attendance outcomes, timeline dots, fieldwork GPS accuracy and actual weather data remain unchanged. */

/* Activity Brief: sync its existing variable-driven theme with Obsidian as well. */
html[data-dyd-global-theme="dark"] body.dyd-activity-brief-page {
  --ab-bg: #08090d;
  --ab-surface: #191e26;
  --ab-text: #f2f5f9;
  --ab-muted: #b5bfcd;
  --ab-line: #3f4957;
  --ab-soft: #252b35;
  --ab-cyan: #83dce8;
  --ab-accent: #7edec9;
  --ab-shadow: 0 14px 35px rgba(0,0,0,.37);
  background: #08090d !important;
}
html[data-dyd-global-theme="dark"] body.dyd-activity-brief-page .ab-hero {
  background: radial-gradient(circle at 85% 23%, rgba(34,101,125,.22), transparent 44%),
              linear-gradient(128deg,#222731,#141821) !important;
  border: 1px solid #444d5b !important;
  border-top: 5px solid #77dfe5 !important;
  box-shadow: var(--dyo-shadow) !important;
}
html[data-dyd-global-theme="dark"] body.dyd-activity-brief-page .ab-hero :is(h1,p) { color:#f3f6fa !important; }
html[data-dyd-global-theme="dark"] body.dyd-activity-brief-page .ab-hero h1 span { color:#88e9cc !important; }
html[data-dyd-global-theme="dark"] body.dyd-activity-brief-page :is(.ab-metrics article,.ab-panel,.ab-picker) {
  background: #1b2028 !important; border-color:#414b58 !important;
  box-shadow: var(--dyo-shadow) !important;
}
html[data-dyd-global-theme="dark"] body.dyd-activity-brief-page :is(.ab-timing div,.ab-table th) {
  background: #2a303b !important;
}
html[data-dyd-global-theme="dark"] body.dyd-activity-brief-page .ab-share textarea {
  background: #252b35 !important; color: #f3f5fa !important; border-color:#596677 !important;
}
/* Keep .ab-badge status colours and .ab-stack legend colours as supplied. */

/* Colouring controls/footers in other pages; preserve contrast without tinting black green. */
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark) :is(.footer-copyright,.service-hours-footnote) { color: #aebcca !important; }
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark) :is(.form-alert,.final-attendance-warning,.fieldwork-attendance-alert) {
  border-color: #d9a65a !important;
  /* Alert wording and status text retain their existing semantic colours. */
}

/* This entire stylesheet is screen-only at its shared include. */

@media (prefers-reduced-motion: reduce) {
  html[data-dyd-global-theme="dark"] body :is(a,button) { transition-duration: 0s !important; }
}

/* Component details. Keep meaning-bearing accents instead of whitening every child. */
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark) :is(
  .volunteer-id,.service-card-identity h3 a:hover,.service-heading-accent,
  .impact-v2-highlight-kicker,.impact-v2-programme-status,.impact-eyebrow,
  .section-label,.impact-home-link,.service-table a,.activity-notes a
) { color: var(--dyo-mint) !important; }
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark) :is(
  .record-count,.service-card-avatar,.volunteer-avatar,.programme-icon,
  .service-how-hours-icon,.manage-v2-programme-icon,.manage-v2-history-icon,
  .impact-v2-date-pill,.attendance-detail-tag,.attendance-source-label
) { background: var(--dyo-surface-high) !important; color: var(--dyo-cyan) !important; border-color: var(--dyo-line) !important; }
html[data-dyd-global-theme="dark"] .service-hours-page progress { accent-color: var(--dyo-mint); }
html[data-dyd-global-theme="dark"] .service-hours-page progress::-webkit-progress-bar { background: #39424e; }
html[data-dyd-global-theme="dark"] .service-hours-page progress::-webkit-progress-value { background: #8be7c2; }
html[data-dyd-global-theme="dark"] .service-hours-page progress::-moz-progress-bar { background: #8be7c2; }
html[data-dyd-global-theme="dark"] :is(.programme-tab,.activity-tab) {
  background: var(--dyo-surface-high); color: var(--dyo-text); border-color: var(--dyo-line);
}
html[data-dyd-global-theme="dark"] .programme-tab.is-active {
  background: #173a33; color: #b4f7dd; border-color: #8be7c2;
  box-shadow: inset 0 -3px #8be7c2;
}
html[data-dyd-global-theme="dark"] :is(.activity-list,.dream-list) { color: var(--dyo-text); }
html[data-dyd-global-theme="dark"] :is(.activity-list li,.dream-list li) { background: var(--dyo-surface-soft); border-color: var(--dyo-line); color: var(--dyo-text); }
html[data-dyd-global-theme="dark"] .historical-record-card.warning-record { border-left-color: var(--dyo-gold) !important; }
html[data-dyd-global-theme="dark"] .historical-record-card:not(.warning-record) { border-left-color: var(--dyo-mint) !important; }
html[data-dyd-global-theme="dark"] :is(.historical-empty-state,.service-empty-state) { color: var(--dyo-muted) !important; }
html[data-dyd-global-theme="dark"] :is(.service-hours-notice,.final-attendance-warning,.fieldwork-attendance-alert,.form-alert,.service-confirmation-note) {
  background: #342a19 !important; color: #ffda91 !important; border-color: #af8843 !important;
}
html[data-dyd-global-theme="dark"] :is(.form-alert,.final-attendance-warning) a { color: #b4f7dd; }
/* One semantic palette feeds cards, guide entries and register badges. */
html[data-dyd-global-theme="dark"] [data-attendance-status="present"] { --status-bg:#173529; --status-text:#9df1be; --status-border:#4a956b; --status-accent:#9df1be; }
html[data-dyd-global-theme="dark"] [data-attendance-status="late"] { --status-bg:#3d291c; --status-text:#ffc28e; --status-border:#b47d48; --status-accent:#ffc28e; }
html[data-dyd-global-theme="dark"] [data-attendance-status="absent"] { --status-bg:#3d2029; --status-text:#ffb4bc; --status-border:#b46a78; --status-accent:#ffb4bc; }
html[data-dyd-global-theme="dark"] [data-attendance-status="excused"] { --status-bg:#1b3049; --status-text:#add4ff; --status-border:#5f88b6; --status-accent:#add4ff; }
html[data-dyd-global-theme="dark"] [data-attendance-status="not-yet-arrived"] { --status-bg:#382f18; --status-text:#ffe19b; --status-border:#a99348; --status-accent:#ffe19b; }
html[data-dyd-global-theme="dark"] [data-attendance-status="pending"] { --status-bg:#292a3e; --status-text:#d1cbff; --status-border:#8780b2; --status-accent:#d1cbff; }
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark) :is(.attendance-metric,.attendance-guide-card,.attendance-recorded-badge)[data-attendance-status] {
  background: var(--status-bg) !important; color: var(--status-text) !important; border-color: var(--status-border) !important;
}
html[data-dyd-global-theme="dark"] .attendance-guide-card :is(strong,span) { color: var(--status-text) !important; }
html[data-dyd-global-theme="dark"] .attendance-choice { background: #222731; color: #dce4ed; border-color: #677483; }
html[data-dyd-global-theme="dark"] .attendance-choice:has(input:checked) { outline: 2px solid #8be7c2; outline-offset: 2px; }

html[data-dyd-global-theme="dark"] .service-hours-heading .form-kicker { background: #1c3338; }
html[data-dyd-global-theme="dark"] .service-stat-verified { border-top-color: var(--dyo-mint) !important; }
html[data-dyd-global-theme="dark"] .service-stat-provisional { border-top-color: var(--dyo-gold) !important; }
html[data-dyd-global-theme="dark"] .service-stat:not(.service-stat-verified):not(.service-stat-provisional) { border-top-color: var(--dyo-cyan) !important; }
html[data-dyd-global-theme="dark"] .activity-hero .status-badge { background: #173529; color: #9df1be; border-color: #4a956b; }
html[data-dyd-global-theme="dark"] .programme-tab[data-programme="schools"].is-active { background: #3b2b1b; color: #ffcf96; border-color: #ffcf96; box-shadow: inset 0 -3px #ffcf96; }
html[data-dyd-global-theme="dark"] .programme-tab[data-programme="youth_development"].is-active { background: #2d2542; color: #d9bdff; border-color: #d9bdff; box-shadow: inset 0 -3px #d9bdff; }
html[data-dyd-global-theme="dark"] .programme-tab[data-programme="community_support"].is-active { background: #18363c; color: #9ee8f1; border-color: #9ee8f1; box-shadow: inset 0 -3px #9ee8f1; }


/* DYD Obsidian handoff finish — 2026-10-26.
   Fix high-contrast gaps left in the otherwise unified Codex dark theme.
   Scope to dark mode; preserve base stylesheet and light appearance. */

/* Our Impact: programme cards used a white gradient while the new theme
   forced white typography into them. Match the programme identity to an
   elevated graphite card without flattening its coloured accent rail. */
html[data-dyd-global-theme="dark"] .impact-v2 .impact-v2-programme-card,
html[data-dyd-global-theme="dark"] .impact-v2 .impact-v2-programme-card.is-inactive {
  background: linear-gradient(145deg, #242a34 0%, #181d25 76%) !important;
  border: 1px solid #495462 !important;
  color: #f0f4f9 !important;
  box-shadow: 0 14px 32px rgba(0,0,0,.28) !important;
}
html[data-dyd-global-theme="dark"] .impact-v2 .impact-v2-programme-card::before {
  opacity: 1;
}
html[data-dyd-global-theme="dark"] .impact-v2 .impact-v2-programme-icon {
  background: #303947 !important;
  border-color: #536273 !important;
}
html[data-dyd-global-theme="dark"] .impact-v2 :is(
  .impact-v2-programme-name,
  .impact-v2-programme-feature strong,
  .impact-v2-programme-feature span,
  .impact-v2-programme-details strong,
  .impact-v2-programme-empty strong
) { color: #f2f5fa !important; }
html[data-dyd-global-theme="dark"] .impact-v2 .impact-v2-programme-status {
  color: #a7e5d6 !important;
  opacity: 1;
}
html[data-dyd-global-theme="dark"] .impact-v2 :is(
  .impact-v2-programme-details,
  .impact-v2-programme-empty p
) { color: #b9c5d1 !important; }
html[data-dyd-global-theme="dark"] .impact-v2 .impact-v2-programme-empty {
  background: #2a323e !important;
  border: 1px solid #495767 !important;
}
html[data-dyd-global-theme="dark"] .impact-v2 .impact-v2-programme-details {
  border-top-color: #465260 !important;
}

/* Our Impact: preserve a clear surface hierarchy for participation, progress
   and end-of-page trust instead of showing pale blocks or near-black labels. */
html[data-dyd-global-theme="dark"] .impact-v2 .impact-v2-participation-number {
  background: #20302e !important;
  color: #f4f8fa !important;
  border-right: 1px solid #4b665f !important;
}
html[data-dyd-global-theme="dark"] .impact-v2 .impact-v2-participation-number :is(strong,span) {
  color: #eff7f5 !important;
}
html[data-dyd-global-theme="dark"] .impact-v2 .impact-v2-attendance-heading {
  color: #dbe5ec !important;
}
html[data-dyd-global-theme="dark"] .impact-v2 .impact-v2-attendance-heading strong {
  color: #95eacb !important;
}
html[data-dyd-global-theme="dark"] .impact-v2 .impact-v2-attendance p {
  color: #b7c3d0 !important;
}
html[data-dyd-global-theme="dark"] .impact-v2 .impact-v2-progress {
  background: #35404b !important;
}
html[data-dyd-global-theme="dark"] .impact-v2 .impact-v2-no-records {
  background: #1b222b !important;
  border-color: #46515f !important;
  color: #d6e2eb !important;
}
html[data-dyd-global-theme="dark"] .impact-v2 .impact-v2-trust :is(strong,p) {
  color: #dbe6ef !important;
}

/* Our Programmes: technical disclosures and progress blocks were still using
   hard-coded white/light-green fills in its inline legacy stylesheet. */
html[data-dyd-global-theme="dark"] .impact-page :is(
  .progress-panel,.technical-details,.technical-item
) {
  background: #212833 !important;
  border-color: #485666 !important;
  color: #edf3f7 !important;
}
html[data-dyd-global-theme="dark"] .impact-page :is(
  .progress-panel strong,.technical-details summary,.technical-name,.technical-group h4,.dream-panel h3
) { color: #e9f3f6 !important; }
html[data-dyd-global-theme="dark"] .impact-page :is(
  .progress-panel p,.technical-code,.technical-meta,.technical-item small,.impact-brand
) { color: #bcc9d4 !important; }
html[data-dyd-global-theme="dark"] .impact-page .technical-details[open] > summary {
  background: #29323e !important;
  border-bottom: 1px solid #485666 !important;
}
html[data-dyd-global-theme="dark"] .impact-page .technical-item + .technical-item {
  margin-top: 1px;
}

/* Milestones: preserve badges and readable contribution figures on graphite.
   Do not change medal colour meaning or attendance/verification logic. */
html[data-dyd-global-theme="dark"] .service-hours-page .service-award-tier {
  color: #f1f5f9 !important;
}
html[data-dyd-global-theme="dark"] .service-hours-page .service-award-tier :is(strong,small) {
  color: #e0e8ee !important;
}
html[data-dyd-global-theme="dark"] .service-hours-page .service-card-highlight :is(strong,span) {
  color: #f1f7fa !important;
}
html[data-dyd-global-theme="dark"] .service-hours-page .service-preview-milestone {
  color: #c6d2dd !important;
}

/* Keep keyboard navigation obvious in the high-contrast interface. */
html[data-dyd-global-theme="dark"] :is(
  .programme-tab,.technical-details summary,.service-profile-link
):focus-visible {
  outline: 3px solid #83dfe9 !important;
  outline-offset: 3px;
}


/* DYD Obsidian 2026-10-26 — targeted operational visual polish (local only).
 * Specific legacy areas continued using light fills or dark-green text.
 * Everything below is scoped to the existing global dark mode. Never recolour
 * Leaflet map tiles, PDF/print layouts or semantic attendance status badges.
 */

/* The historical paper-record capture page still inherited green-on-charcoal
   headers and small descriptions. Keep its existing upload and capture forms. */
html[data-dyd-global-theme="dark"] .historical-page :is(
  .historical-action-card h2, .historical-section h2, .historical-record-card h3
),
html[data-dyd-global-theme="dark"] .historical-form-page :is(
  .historical-form-section h2, .historical-form-section h3
) { color: #f2f5fa !important; }
html[data-dyd-global-theme="dark"] .historical-page :is(
  .historical-action-card p, .historical-section-heading p,
  .historical-record-card p, .historical-record-card small,
  .historical-upload-form small
),
html[data-dyd-global-theme="dark"] .historical-form-page .historical-capture-form small {
  color: #bac7d5 !important;
}
html[data-dyd-global-theme="dark"] .historical-page .historical-upload-form label,
html[data-dyd-global-theme="dark"] .historical-form-page .historical-capture-form label {
  color: #eaf0f7 !important;
}
html[data-dyd-global-theme="dark"] .historical-page .historical-action-icon {
  background: #27313a !important;
  color: #8ce8c5 !important;
}
html[data-dyd-global-theme="dark"] .historical-form-page :is(
  .historical-form-section, .historical-not-held
) { background: #1a1f28 !important; border-color: #45505e !important; }
html[data-dyd-global-theme="dark"] .historical-form-page .historical-not-held :is(strong,p) {
  color: #f1c6b5 !important;
}

/* Each programme must retain its OWN environmental, schools, youth or
   community identity — a coloured outline and subtle matching shells,
   rather than four indistinguishable dark panels. */
html[data-dyd-global-theme="dark"] .impact-page .programme-panel {
  --dyop-outline: #58c891;
  --dyop-wash: rgba(52, 164, 103, .17);
  border: 2px solid var(--dyop-outline) !important;
  background: #181e27 !important;
  box-shadow: 0 20px 44px rgba(0,0,0,.36), 0 0 0 4px var(--dyop-wash) !important;
}
html[data-dyd-global-theme="dark"] .impact-page .programme-panel[data-programme="schools"] {
  --dyop-outline: #72bafa;
  --dyop-wash: rgba(69, 152, 220, .17);
}
html[data-dyd-global-theme="dark"] .impact-page .programme-panel[data-programme="youth_development"] {
  --dyop-outline: #ffc073;
  --dyop-wash: rgba(232, 156, 67, .17);
}
html[data-dyd-global-theme="dark"] .impact-page .programme-panel[data-programme="community_support"] {
  --dyop-outline: #c5a0ef;
  --dyop-wash: rgba(153, 111, 217, .17);
}
html[data-dyd-global-theme="dark"] .impact-page .programme-panel .programme-header {
  background: linear-gradient(120deg, var(--dyop-wash), #212733 76%) !important;
  border-bottom: 1px solid var(--dyop-outline) !important;
  box-shadow: inset 0 4px var(--dyop-outline) !important;
}
html[data-dyd-global-theme="dark"] .impact-page .programme-panel .programme-header h2 {
  color: #f4f7fb !important;
}
html[data-dyd-global-theme="dark"] .impact-page .programme-panel .programme-header p {
  color: #d0dce6 !important;
}
html[data-dyd-global-theme="dark"] .impact-page .programme-panel .programme-icon {
  background: #303744 !important;
  border: 1px solid var(--dyop-outline) !important;
}
html[data-dyd-global-theme="dark"] .impact-page .programme-panel .programme-content {
  background: #191e27 !important;
}
html[data-dyd-global-theme="dark"] .impact-page .programme-panel .programme-section {
  border-bottom-color: #3b4655 !important;
}
html[data-dyd-global-theme="dark"] .impact-page .programme-panel .section-label {
  color: var(--dyop-outline) !important;
}
html[data-dyd-global-theme="dark"] .impact-page .programme-panel .programme-section h3 {
  color: #eef3f9 !important;
}
html[data-dyd-global-theme="dark"] .impact-page .programme-panel .programme-section-intro {
  color: #c0ccda !important;
}
html[data-dyd-global-theme="dark"] .impact-page .programme-panel :is(
  .story-card, .dream-panel, .progress-panel, .technical-details
) {
  border: 1px solid #45515e !important;
  border-left: 3px solid var(--dyop-outline) !important;
  background: #242a34 !important;
}
html[data-dyd-global-theme="dark"] .impact-page .programme-panel .activity-list li {
  background: #262e38 !important;
  color: #edf3f8 !important;
  border-color: #516170 !important;
}

/* Reporting: the evidence block was still WHITE while the text was being
   made light by the global theme. This is the source of the unreadable area
   after pressing 'Complete Report' from Manage Activities. */
html[data-dyd-global-theme="dark"] .report-page :is(
  .report-kpi-grid article, .report-draft-verification,
  .report-complete-hero, .report-fieldwork-map-panel,
  .report-evidence-card, .report-recorded-evidence-note
) {
  background: #1d232c !important;
  color: #eff4f8 !important;
  border-color: #475563 !important;
  box-shadow: 0 12px 32px rgba(0,0,0,.23) !important;
}
html[data-dyd-global-theme="dark"] .report-page :is(
  .report-kpi-grid span, .report-draft-verification-heading p,
  .location-verification-intro, .location-verification-note,
  .report-fieldwork-map-heading p, .report-fieldwork-map-note,
  .report-fieldwork-map-legend, .report-recorded-evidence-note p,
  .report-complete-hero p, .report-narrative-section p
) { color: #c5d1dc !important; }
html[data-dyd-global-theme="dark"] .report-page :is(
  .report-kpi-grid strong, .report-draft-verification-heading h2,
  .report-fieldwork-map-heading h3, .report-narrative-section h3,
  .report-complete-hero h1, .report-recorded-evidence-note strong
) { color: #f4f7fa !important; }
html[data-dyd-global-theme="dark"] .report-page :is(
  .location-verification-list article,
  .location-verification-metrics article,
  .report-narrative-section
) {
  background: #28303a !important;
  border-color: #45535e !important;
  color: #edf3f8 !important;
}
html[data-dyd-global-theme="dark"] .report-page :is(
  .location-verification-list span, .location-verification-metrics span,
  .location-verification-list small, .location-verification-metrics small
) { color: #becbd7 !important; }
html[data-dyd-global-theme="dark"] .report-page :is(
  .location-verification-list strong, .location-verification-metrics strong,
  .report-evidence-row-heading, .gps-technical-details summary
) { color: #f2f6f9 !important; }
html[data-dyd-global-theme="dark"] .report-page .report-draft-verification {
  border-left: 4px solid #78dce8 !important;
}
html[data-dyd-global-theme="dark"] .report-page .report-evidence-lock {
  background: #17372e !important;
  border-color: #529a80 !important;
  color: #b1f6dd !important;
}
html[data-dyd-global-theme="dark"] .report-page .report-recorded-evidence-note {
  border-left: 4px solid #ebbd6d !important;
}
html[data-dyd-global-theme="dark"] .report-page .location-verification-note {
  background: #233344 !important;
  border: 1px solid #4b7598 !important;
}
html[data-dyd-global-theme="dark"] .report-page .report-fieldwork-map-location {
  background: #273a37 !important;
  border: 1px solid #457665 !important;
  color: #d5f7e5 !important;
}
html[data-dyd-global-theme="dark"] .report-page .report-fieldwork-map-badge {
  background: #1c3c2d !important;
  border: 1px solid #56916d !important;
  color: #bef5ce !important;
}
/* Do not theme .leaflet-tile, attribution, map markers or the OSM imagery. */

/* Open-Meteo read-only snapshot: exact measured/modelled values remain the
   same. Only the hard-coded light background and label colours change. */
html[data-dyd-global-theme="dark"] .report-page .fieldwork-weather-snapshot {
  background: #1a2029 !important;
  border-color: #485361 !important;
}
html[data-dyd-global-theme="dark"] .report-page .fieldwork-weather-snapshot-hero {
  background: linear-gradient(120deg, #202f36, #1d2631 70%, #232934) !important;
}
html[data-dyd-global-theme="dark"] .report-page :is(
  .fieldwork-weather-snapshot-main h3,
  .fieldwork-weather-snapshot-temperature strong,
  .fieldwork-weather-snapshot-metrics strong
) { color: #f2f8fa !important; }
html[data-dyd-global-theme="dark"] .report-page :is(
  .fieldwork-weather-snapshot-time,
  .fieldwork-weather-snapshot-temperature span,
  .fieldwork-weather-snapshot-metrics span,
  .fieldwork-weather-snapshot-footer
) { color: #c2cfd9 !important; }
html[data-dyd-global-theme="dark"] .report-page .fieldwork-weather-snapshot-metrics {
  border-color: #45505b !important;
  background: #202630 !important;
}
html[data-dyd-global-theme="dark"] .report-page .fieldwork-weather-snapshot-metrics article + article {
  border-left-color: #414e5b !important;
}
html[data-dyd-global-theme="dark"] .report-page :is(
  .fieldwork-weather-metric-icon,.fieldwork-weather-snapshot-icon
) { background: #2d3944 !important; border-color: #536270 !important; }
html[data-dyd-global-theme="dark"] .report-page .fieldwork-weather-snapshot-footer {
  background: #1c232d !important;
}
html[data-dyd-global-theme="dark"] .report-page .report-form-section .form-section-heading :is(h2,p) {
  color: #eff5fa !important;
}
html[data-dyd-global-theme="dark"] .report-page .optional-label {
  color: #bac6d2 !important;
}

/* The same read-only GPS evidence component also appears on Activity Details. */
html[data-dyd-global-theme="dark"] .activity-fieldwork-evidence-panel :is(
  .location-verification-list article, .location-verification-metrics article
) { background: #27303b !important; border-color: #485665 !important; }
html[data-dyd-global-theme="dark"] .activity-fieldwork-evidence-panel :is(
  .location-verification-list strong, .location-verification-metrics strong,
  .activity-fieldwork-evidence-heading h2
) { color: #eff4f9 !important; }
html[data-dyd-global-theme="dark"] .activity-fieldwork-evidence-panel :is(
  .location-verification-list span, .location-verification-list small,
  .location-verification-metrics span, .location-verification-metrics small,
  .activity-fieldwork-evidence-heading p
) { color: #c4d0db !important; }
html[data-dyd-global-theme="dark"] .activity-fieldwork-evidence-panel .activity-recorded-evidence-badge {
  background: #1b362e !important; color: #b7f3da !important; border-color: #4e9074 !important;
}

/* ================================================================
   DYD Obsidian v4 — small remaining light-mode islands
   26 October 2026. SCREEN / DARK ONLY; no templates or logic changed.
   All selectors are scoped to the existing page components.
   ================================================================ */

/* 1. Activity report: photo-permission checkbox, review reminder and
      action bar had hard-coded light surfaces inherited from style.css. */
html[data-dyd-global-theme="dark"] .report-page .report-evidence-consent {
  background: #202a30 !important;
  border: 1px solid #517566 !important;
  color: #e5f1ec !important;
}
html[data-dyd-global-theme="dark"] .report-page .report-evidence-consent > span {
  color: #e5f1ec !important;
}
html[data-dyd-global-theme="dark"] .report-page .report-evidence-consent input[type="checkbox"] {
  accent-color: #86e4ba;
}
html[data-dyd-global-theme="dark"] .report-page .report-completion-warning {
  background: #1b2c26 !important;
  border: 1px solid #50816a !important;
}
html[data-dyd-global-theme="dark"] .report-page .report-completion-warning strong {
  color: #99edc9 !important;
}
html[data-dyd-global-theme="dark"] .report-page .report-completion-warning span {
  color: #cfddd6 !important;
}
html[data-dyd-global-theme="dark"] .report-page .assignment-actions {
  background: #1d232d !important;
  border: 1px solid #475461 !important;
  box-shadow: 0 10px 26px rgba(0,0,0,.24) !important;
}

/* 2. New Activity: the 4-step progress strip used a white base, and
      inactive steps became illegible against it after global theming. */
html[data-dyd-global-theme="dark"] .form-page .lifecycle-progress {
  background: #212833 !important;
  border: 1px solid #4d5c6b !important;
}
html[data-dyd-global-theme="dark"] .form-page .lifecycle-step {
  color: #c6d2de !important;
}
html[data-dyd-global-theme="dark"] .form-page .lifecycle-step .lifecycle-number {
  background: #161c26 !important;
  border-color: #778596 !important;
  color: #f0f4f9 !important;
}
html[data-dyd-global-theme="dark"] .form-page .lifecycle-step-active {
  color: #9cf2cc !important;
}
html[data-dyd-global-theme="dark"] .form-page .lifecycle-step-active .lifecycle-number {
  background: #8be7c2 !important;
  border-color: #a5f2d5 !important;
  color: #102322 !important;
  box-shadow: 0 0 0 4px rgba(139,231,194,.13) !important;
}
html[data-dyd-global-theme="dark"] .form-page .lifecycle-line {
  background: #627181 !important;
}

/* 3. Attendance register: bottom navigation and collapsed status guide
      must match the graphite panels, without changing attendance colours. */
html[data-dyd-global-theme="dark"] .volunteer-page .assignment-actions {
  background: #1d232d !important;
  border: 1px solid #485665 !important;
  box-shadow: 0 10px 26px rgba(0,0,0,.22) !important;
}
html[data-dyd-global-theme="dark"] .volunteer-page .attendance-guide-disclosure {
  background: #1b222c !important;
  border: 1px solid #475462 !important;
}
html[data-dyd-global-theme="dark"] .volunteer-page .attendance-guide-disclosure > summary {
  color: #a3eaca !important;
}
html[data-dyd-global-theme="dark"] .volunteer-page .attendance-guide-disclosure > summary span {
  color: #c1cedb !important;
}
html[data-dyd-global-theme="dark"] .volunteer-page .attendance-guide-disclosure .attendance-status-guide > .attendance-guide-card {
  border-color: var(--status-border, #586777) !important;
  background: var(--status-bg, #262f3b) !important;
}
html[data-dyd-global-theme="dark"] .volunteer-page .attendance-guide-disclosure .attendance-guide-card :is(strong, span) {
  color: var(--status-text, #e1ebf2) !important;
}


/* ====================================================================
   DYD Obsidian v5 — Administration finishing pass, 26 October 2026
   Admin areas only. Keeps Command Centre's already-approved styling.
   One appearance preference from dyd_global_theme.js, homepage switch only.
   ==================================================================== */

/* Protected User Management and Audit History pages use the same
   black canvas / graphite tiering as the rest of the DYD workspace. */
html[data-dyd-global-theme="dark"] body.dyd-admin-users-v5 .admin-page,
html[data-dyd-global-theme="dark"] body.admin-audit-v2-body .admin-page,
html[data-dyd-global-theme="dark"] body.dyd-admin-user-form-v5 .form-page {
  color: #f1f5fa;
}
html[data-dyd-global-theme="dark"] body.dyd-admin-users-v5 :is(.directory-hero,.admin-user-panel),
html[data-dyd-global-theme="dark"] body.admin-audit-v2-body :is(.directory-hero,.admin-audit-v2-filter-panel,.admin-audit-v2-panel),
html[data-dyd-global-theme="dark"] body.dyd-admin-user-form-v5 .form-card {
  background: linear-gradient(145deg,#1e232c,#141821) !important;
  border: 1px solid #414c59 !important;
  box-shadow: 0 16px 40px rgba(0,0,0,.38),inset 0 1px rgba(255,255,255,.05) !important;
  color: #f4f6fa !important;
}
html[data-dyd-global-theme="dark"] body.dyd-admin-users-v5 .admin-hero,
html[data-dyd-global-theme="dark"] body.admin-audit-v2-body .admin-hero {
  border-top: 4px solid #71dfe5 !important;
  background: radial-gradient(circle at 100% 15%,rgba(41,108,132,.15),transparent 43%),linear-gradient(135deg,#1d232d,#12161d) !important;
}
html[data-dyd-global-theme="dark"] body.dyd-admin-users-v5 :is(.admin-hero h1,.admin-user-identity strong,.activity-panel h2),
html[data-dyd-global-theme="dark"] body.admin-audit-v2-body :is(.admin-hero h1,.activity-panel h2,.admin-audit-v2-action-line > strong,.admin-audit-v2-meta strong),
html[data-dyd-global-theme="dark"] body.dyd-admin-user-form-v5 :is(.form-heading h1,.form-group label) {
  color: #f4f7fb !important;
}
html[data-dyd-global-theme="dark"] body.dyd-admin-users-v5 :is(.admin-hero p,.admin-user-identity small,.directory-stat span),
html[data-dyd-global-theme="dark"] body.admin-audit-v2-body :is(.admin-hero p,.directory-stat span,.admin-audit-v2-target,.admin-audit-v2-related,.admin-audit-v2-meta span,.admin-audit-v2-meta time),
html[data-dyd-global-theme="dark"] body.dyd-admin-user-form-v5 :is(.form-heading p,.field-help,.optional-label) {
  color: #c1cbd6 !important;
}
html[data-dyd-global-theme="dark"] body.dyd-admin-users-v5 .admin-role-stat,
html[data-dyd-global-theme="dark"] body.admin-audit-v2-body .admin-role-stat {
  background: #161d26 !important;
  border: 1px solid #415568 !important;
  border-top: 3px solid #75dce6 !important;
  border-radius: 17px !important;
}
html[data-dyd-global-theme="dark"] body.dyd-admin-users-v5 .admin-role-stat strong,
html[data-dyd-global-theme="dark"] body.admin-audit-v2-body .admin-role-stat strong {
  color: #f5f7fb !important;
}

/* User list: black graphite rows; account state remains recognisable. */
html[data-dyd-global-theme="dark"] body.dyd-admin-users-v5 .admin-user-row {
  background: #222833 !important;
  border: 1px solid #465364 !important;
  box-shadow: inset 0 1px rgba(255,255,255,.035) !important;
}
html[data-dyd-global-theme="dark"] body.dyd-admin-users-v5 .admin-user-avatar {
  background: #233f43 !important;
  border: 1px solid #427b79 !important;
  color: #a5f1e1 !important;
}
html[data-dyd-global-theme="dark"] body.dyd-admin-users-v5 .admin-user-row .status-badge:not(.status-active):not(.status-inactive) {
  background: #27323e !important;
  color: #daecf3 !important;
  border: 1px solid #43596a !important;
}
html[data-dyd-global-theme="dark"] body.dyd-admin-users-v5 .admin-user-row .status-active {
  background: #1a382c !important; border-color: #4e9372 !important; color: #a7f0cb !important;
}
html[data-dyd-global-theme="dark"] body.dyd-admin-users-v5 .admin-user-row .status-inactive {
  background: #392a28 !important; border-color: #91605b !important; color: #ffcbc3 !important;
}

/* Audit filters and event timeline: old style.css hardcodes light rows
   and green-on-green action/category copy; keep semantic category rails. */
html[data-dyd-global-theme="dark"] body.admin-audit-v2-body .admin-audit-v2-filters label > span {
  color: #deecf4 !important;
}
html[data-dyd-global-theme="dark"] body.admin-audit-v2-body .admin-audit-v2-filters :is(input,select) {
  background: #202732 !important;
  color: #f1f5fa !important;
  border: 1px solid #5b6d80 !important;
  color-scheme: dark;
}
html[data-dyd-global-theme="dark"] body.admin-audit-v2-body .admin-audit-v2-row {
  background: #202630 !important;
  border-top-color: #425060 !important;
  border-right-color: #425060 !important;
  border-bottom-color: #425060 !important;
  color: #e6edf3 !important;
}
html[data-dyd-global-theme="dark"] body.admin-audit-v2-body .admin-audit-v2-icon {
  background: #303b46 !important;
  color: #d7ebec !important;
}
html[data-dyd-global-theme="dark"] body.admin-audit-v2-body .admin-audit-v2-category {
  background: #2b3641 !important;
  color: #d0e3eb !important;
}
html[data-dyd-global-theme="dark"] body.admin-audit-v2-body :is(.admin-audit-v2-target a,.admin-audit-v2-related a) {
  color: #a0eddb !important;
}
html[data-dyd-global-theme="dark"] body.admin-audit-v2-body .admin-audit-v2-target small {
  color: #abbcca !important;
}
html[data-dyd-global-theme="dark"] body.admin-audit-v2-body .admin-audit-v2-empty {
  background: #202630 !important;
  border: 1px dashed #536171 !important;
  border-radius: 14px !important;
}
html[data-dyd-global-theme="dark"] body.admin-audit-v2-body .admin-audit-v2-empty :is(p,strong) {
  color: #e8eef4 !important;
}

/* Account create/edit: explicitly scope so Login and Access Denied
   do not inherit admin-only refinements. */
html[data-dyd-global-theme="dark"] body.dyd-admin-user-form-v5 .form-group :is(input,select) {
  background: #232a34 !important;
  border: 1px solid #586879 !important;
  color: #f2f5f9 !important;
  color-scheme: dark;
}
html[data-dyd-global-theme="dark"] body.dyd-admin-user-form-v5 .form-group :is(input,select)::placeholder {
  color: #b1becc !important;
  opacity: 1;
}
html[data-dyd-global-theme="dark"] body.dyd-admin-user-form-v5 .field-error {
  color: #ffc0bf !important;
}
html[data-dyd-global-theme="dark"] body.dyd-admin-user-form-v5 .form-alert {
  background: #3e282b !important;
  border-color: #aa6b70 !important;
}
html[data-dyd-global-theme="dark"] body.dyd-admin-user-form-v5 .form-alert :is(strong,span) {
  color: #ffe2df !important;
}
html[data-dyd-global-theme="dark"] body.dyd-admin-user-form-v5 .form-actions {
  border-color: #394858 !important;
}

/* Activity Impact & Attendance Brief: align its header with the black
   Command Centre, preserving the evidence colours and print-specific layout. */
html[data-dyd-global-theme="dark"] body.dyd-activity-brief-page .ab-hero {
  border: 1px solid #43515f !important;
  border-top: 4px solid #75e0dd !important;
  background: radial-gradient(circle at 93% 10%,rgba(55,106,132,.18),transparent 35%),linear-gradient(125deg,#1d222d,#11151c 70%,#1a222d) !important;
  box-shadow: 0 20px 45px rgba(0,0,0,.38) !important;
}
html[data-dyd-global-theme="dark"] body.dyd-activity-brief-page .ab-hero .ab-kicker { color: #84dce9 !important; }
html[data-dyd-global-theme="dark"] body.dyd-activity-brief-page .ab-hero h1 span { color: #91ebcd !important; }
html[data-dyd-global-theme="dark"] body.dyd-activity-brief-page .ab-hero p { color: #c4cfdb !important; }

/* Light-mode polish for the admin-only record pages: retain their familiar
   bright surfaces and DYD branding rather than forcing dark styling. */
html[data-dyd-global-theme="light"] body.dyd-admin-users-v5 .admin-hero,
html[data-dyd-global-theme="light"] body.admin-audit-v2-body .admin-hero {
  border-top: 4px solid #42c8c1;
}
html[data-dyd-global-theme="light"] body.dyd-admin-users-v5 .admin-user-row,
html[data-dyd-global-theme="light"] body.admin-audit-v2-body .admin-audit-v2-row {
  box-shadow: 0 8px 22px rgba(12,42,40,.045);
}

/* Shared keyboard visibility and mobile layout. */
html[data-dyd-global-theme="dark"] body:is(.dyd-admin-users-v5,.dyd-admin-user-form-v5,.admin-audit-v2-body)
  :is(a,button,input,select,textarea):focus-visible {
  outline: 3px solid #80e5ed !important;
  outline-offset: 3px;
}
@media (max-width: 820px) {
  body.dyd-admin-users-v5 .admin-user-row {
    grid-template-columns: 42px minmax(0,1fr) auto;
    gap: 10px;
  }
  body.dyd-admin-users-v5 .admin-user-row .admin-user-identity { min-width: 0; overflow-wrap: anywhere; }
  body.dyd-admin-users-v5 .admin-user-row > a.button { grid-column: 2 / -1; justify-self: stretch; text-align: center; }
  body.dyd-admin-users-v5 .admin-user-row .status-badge { justify-self: start; }
}
@media (max-width: 520px) {
  body.dyd-admin-users-v5 .admin-user-row { grid-template-columns: 42px minmax(0,1fr); }
  body.dyd-admin-users-v5 .admin-user-row .status-badge { grid-column: 2; }
  body.dyd-admin-users-v5 .admin-user-row > a.button { grid-column: 1 / -1; }
}


/* DYD production visual hotfix v6 — 2026-10-26.
   Three narrowly scoped, SCREEN-ONLY repairs discovered after authenticated
   production review: historical record, minutes detail, impact wrapper seam.
   No forms, status calculations, print/PDF, fieldwork, data, or light theme. */

/* 1. Historical record details: the original light activity-summary tiles were
   never remapped by the global graphite surface rule. Preserve the two-column
   data grid and all values; only fix backgrounds, headings and legibility. */
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark)
  .historical-form-page .activity-summary {
  background: #465261 !important;
  border-color: #465261 !important;
  box-shadow: none !important;
}
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark)
  .historical-form-page .activity-summary > div {
  background: #222933 !important;
  color: #f0f5f9 !important;
}
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark)
  .historical-form-page .activity-summary dt {
  color: #b6c6d6 !important;
}
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark)
  .historical-form-page .activity-summary dd {
  color: #f3f6fa !important;
}
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark)
  .historical-form-page .historical-record-text article {
  background: #222933 !important;
  border-color: #465261 !important;
  color: #edf3f9 !important;
}
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark)
  .historical-form-page .historical-record-text h3 {
  color: #f3f6fa !important;
}
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark)
  .historical-form-page .historical-record-text p {
  color: #cad6e2 !important;
}
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark)
  .historical-form-page .historical-evidence-panel small {
  color: #bcc9d6 !important;
}
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark)
  .historical-form-page .directory-hero .status-badge {
  background: #1b382e !important;
  border: 1px solid #4b8d70 !important;
  color: #a0efd0 !important;
}

/* 2. Opened meeting-minutes record: the saved text itself remained #465149,
   nearly black on the new graphite panels. Use a unique page class, not a
   broad global paragraph selector. Preserve line breaks and finalised state. */
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark)
  .minutes-detail-page .minutes-preserved-text {
  color: #d7e0e9 !important;
}
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark)
  .minutes-detail-page .activity-detail-grid dd {
  color: #f0f4f9 !important;
}
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark)
  .minutes-detail-page .admin-restore-note {
  background: #1b302b !important;
  border: 1px solid #3f806a !important;
  color: #cfdfd9 !important;
}
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark)
  .minutes-detail-page .admin-restore-note strong {
  color: #94e6bc !important;
}
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark)
  .minutes-detail-page .admin-restore-note span {
  color: #d8e6e1 !important;
}

/* 3. Results & Impact: participation/programmes/latest are section wrappers,
   NOT cards. The generic Obsidian rule wrongly painted their rectangular
   backgrounds, revealing square slabs around genuine rounded child cards.
   Restore transparent wrapper surfaces and keep all child cards untouched. */
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark)
  .impact-v2 > :is(.impact-v2-participation, .impact-v2-programmes, .impact-v2-latest) {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}


/* DYD Obsidian V7 — 2026-10-29. TEAM ASSIGNMENT + UPDATE NOTICE.
   Carefully scoped screen-only contrast corrections. No logic, data or light mode.
   Applies after the V6 historical/minutes/impact fixes. */

/* Assign Volunteers: toolbar inherited a white background from base style.css.
   Keep the search input, responsive columns and selection behaviour unchanged. */
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark)
  .volunteer-page .assignment-toolbar {
  background: #1d232c !important;
  border-color: #465361 !important;
  color: #f3f6fa !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .28) !important;
}
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark)
  .volunteer-page .assignment-toolbar h2 {
  color: #f3f6fa !important;
}
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark)
  .volunteer-page .volunteer-search input::placeholder {
  color: #b8c5d3 !important;
  opacity: 1;
}

/* Assignment cards already use graphite, but their names and metadata kept
   the legacy dark-green/grey colours and the Select pill was nearly white. */
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark)
  .volunteer-page .assignment-card .assignment-card-content h3 {
  color: #f4f7fa !important;
}
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark)
  .volunteer-page .assignment-card .assignment-meta,
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark)
  .volunteer-page .assignment-card .assignment-meta span {
  color: #bdc9d6 !important;
}
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark)
  .volunteer-page .assignment-card .selection-indicator {
  background: #2b3440 !important;
  border: 1px solid #576574 !important;
  color: #edf3f8 !important;
}
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark)
  .volunteer-page .assignment-card.assignment-card-selected {
  background: #1d302e !important;
  border-color: #8be7c2 !important;
  box-shadow: inset 0 0 0 1px rgba(139,231,194,.22) !important;
}
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark)
  .volunteer-page .assignment-card.assignment-card-selected .selection-indicator {
  background: #8be7c2 !important;
  border-color: #a9efd6 !important;
  color: #102522 !important;
}
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark)
  .volunteer-page .assignment-card:focus-within {
  outline: 3px solid #8fe8e6 !important;
  outline-offset: 3px;
}

/* Rarely used but part of the same form: previously light-only informational
   boxes for retained inactive assignments and coordinator notification. */
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark)
  .volunteer-page .inactive-assignment-panel {
  background: #24252b !important;
  border-color: #65604b !important;
}
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark)
  .volunteer-page .inactive-assignment-panel .panel-heading p {
  color: #c6ccd1 !important;
}
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark)
  .volunteer-page .inactive-assignment-card,
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark)
  .volunteer-page .inactive-assignment-card[data-volunteer-status="on-pause"],
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark)
  .volunteer-page .inactive-assignment-card[data-volunteer-status="former-volunteer"] {
  background: #252b35 !important;
  border-top-color: #515a64 !important;
  border-right-color: #515a64 !important;
  border-bottom-color: #515a64 !important;
}
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark)
  .volunteer-page .inactive-assignment-card .assignment-card-content h3 {
  color: #f1f5fa !important;
}
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark)
  .volunteer-page .inactive-assignment-card .assignment-meta {
  color: #c3ced8 !important;
}
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark)
  .volunteer-page .team-communication-reminder {
  background: #342a1e !important;
  border-color: #9c7d4b !important;
  color: #f2e3c2 !important;
}
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark)
  .volunteer-page .team-communication-reminder strong {
  color: #ffdc98 !important;
}
html[data-dyd-global-theme="dark"] body:not(.dyd-admin-command-dark)
  .volunteer-page .team-communication-reminder :is(p,small) {
  color: #e4d5b5 !important;
}

/* Activity Overview: the update-confirmation banner retained its mint-on-white
   Light Mode look. Preserve successful-status semantics but restore contrast. */
html[data-dyd-global-theme="dark"] body.activity-details-page-body .success-banner {
  background: #1c342e !important;
  border-color: #4b9378 !important;
  color: #e3f5ed !important;
  box-shadow: 0 8px 22px rgba(0,0,0,.20) !important;
}
html[data-dyd-global-theme="dark"] body.activity-details-page-body .success-banner > span {
  background: #8be7c2 !important;
  color: #102a24 !important;
}
html[data-dyd-global-theme="dark"] body.activity-details-page-body .success-banner strong {
  color: #a7f0d0 !important;
}
html[data-dyd-global-theme="dark"] body.activity-details-page-body .success-banner small {
  color: #c4dcd4 !important;
}


/* DYD V8 · Approved activity report photo captions (dark mode only).
   The existing light-theme caption colour #26352a was inherited in Obsidian
   despite the gallery cards becoming graphite. Keep photo/category content and
   published report layout unchanged; restore readable evidence captions. */
html[data-dyd-global-theme="dark"] .report-page
  .report-evidence-gallery-section .panel-heading p {
  color: #c2ceda !important;
}
html[data-dyd-global-theme="dark"] .report-page
  .report-evidence-gallery .report-evidence-card figcaption {
  background: #1d232c !important;
}
html[data-dyd-global-theme="dark"] .report-page
  .report-evidence-gallery .report-evidence-card figcaption span {
  color: #8fe7bc !important;
}
html[data-dyd-global-theme="dark"] .report-page
  .report-evidence-gallery .report-evidence-card figcaption strong {
  color: #f0f5f9 !important;
}
