/* Final contrast guard.
 * Loaded after module CSS to prevent pale-on-pale UI in light mode and washed controls in dark mode.
 */

:root {
  --cdg-a11y-text: var(--text, #f5f7fb);
  --cdg-a11y-strong: var(--text-strong, #ffffff);
  --cdg-a11y-muted: var(--muted, #adc0d5);
  --cdg-a11y-surface: var(--surface, rgba(11, 22, 36, 0.76));
  --cdg-a11y-surface-soft: var(--surface-alt, rgba(17, 32, 52, 0.82));
  --cdg-a11y-control: rgba(15, 30, 48, 0.82);
  --cdg-a11y-control-hover: rgba(27, 47, 74, 0.95);
  --cdg-a11y-border: var(--border, rgba(163, 183, 205, 0.24));
  --cdg-a11y-row: var(--table-row-alt, rgba(14, 25, 40, 0.42));
  --cdg-a11y-row-hover: var(--table-row-hover, rgba(89, 168, 255, 0.12));
  --cdg-a11y-table-bg: var(--table-bg, rgba(9, 20, 33, 0.72));
  --cdg-a11y-table-head: var(--table-head-bg, rgba(16, 30, 48, 0.78));
  --cdg-a11y-table-border: var(--table-border, rgba(163, 183, 205, 0.24));
  --cdg-a11y-primary: var(--primary, var(--app-accent, #59a8ff));
  --cdg-a11y-primary-strong: var(--primary-dark, #2d86f0);
}

html[data-theme="light"],
:root[data-theme="light"],
html[data-theme-effective="light"],
:root[data-theme-effective="light"],
body[data-theme="light"]:not(.dark-mode),
body[data-theme-effective="light"],
body.theme-light,
html[data-theme="system"],
:root[data-theme="system"],
body[data-theme="system"] {
  --text: #102133;
  --text-strong: #061424;
  --muted: #40566f;
  --text-muted: #40566f;
  --portal-text-muted: #40566f;
  --app-text-muted: #40566f;
  --table-head-bg: #d2e1ef;
  --table-row-alt: #e9f2fa;
  --table-row-hover: #d8e9f7;
  --table-bg: #f9fcff;
  --table-border: #a9bed3;
  --table-cell-border: #bdcfdf;
  --table-head-text: #1d334a;
  --table-label: #334a62;
  --input-bg: #ffffff;
  --input-border: #9dafc1;
  --input-placeholder: #5b7088;
  --cdg-a11y-text: #102133;
  --cdg-a11y-strong: #061424;
  --cdg-a11y-muted: #40566f;
  --cdg-a11y-surface: #ffffff;
  --cdg-a11y-surface-soft: #edf4fb;
  --cdg-a11y-control: #e4eef8;
  --cdg-a11y-control-hover: #d7e7f5;
  --cdg-a11y-border: #9fb7cf;
  --cdg-a11y-row: #e9f2fa;
  --cdg-a11y-row-hover: #d8e9f7;
  --cdg-a11y-table-bg: #f9fcff;
  --cdg-a11y-table-head: #d2e1ef;
  --cdg-a11y-table-border: #a9bed3;
  --cdg-a11y-primary: #1267c2;
  --cdg-a11y-primary-strong: #0d4f9e;
}

html[data-theme="dark"],
:root[data-theme="dark"],
html[data-theme-effective="dark"],
:root[data-theme-effective="dark"],
body[data-theme="dark"],
body[data-theme-effective="dark"],
body.dark-mode,
body.theme-dark {
  --text: #f5f7fb;
  --text-strong: #ffffff;
  --muted: #c6d5e6;
  --portal-text-muted: #c6d5e6;
  --text-muted: #c6d5e6;
  --app-text-muted: #c6d5e6;
  --table-head-bg: rgba(30, 48, 72, 0.96);
  --table-row-alt: rgba(20, 36, 56, 0.9);
  --table-row-hover: rgba(47, 91, 136, 0.7);
  --table-bg: rgba(9, 20, 33, 0.94);
  --table-border: rgba(174, 195, 218, 0.34);
  --table-cell-border: rgba(174, 195, 218, 0.24);
  --table-head-text: #f8fbff;
  --table-label: #dbe8f7;
  --input-bg: #0d1b2d;
  --input-border: rgba(190, 207, 226, 0.42);
  --input-placeholder: #c6d5e6;
  --status-success-bg: rgba(16, 185, 129, 0.2);
  --status-success-border: #34d399;
  --status-success-text: #d1fae5;
  --status-warning-bg: rgba(234, 179, 8, 0.2);
  --status-warning-border: #fbbf24;
  --status-warning-text: #fef3c7;
  --status-danger-bg: rgba(239, 68, 68, 0.18);
  --status-danger-border: #f87171;
  --status-danger-text: #fee2e2;
  --status-info-bg: rgba(59, 130, 246, 0.22);
  --status-info-border: #60a5fa;
  --status-info-text: #dbeafe;
  --status-muted-bg: rgba(148, 163, 184, 0.18);
  --status-muted-border: #94a3b8;
  --status-muted-text: #f1f5f9;
  --cdg-a11y-text: #f5f7fb;
  --cdg-a11y-strong: #ffffff;
  --cdg-a11y-muted: #c6d5e6;
  --cdg-a11y-surface: rgba(11, 22, 36, 0.94);
  --cdg-a11y-surface-soft: rgba(17, 32, 52, 0.96);
  --cdg-a11y-control: rgba(20, 36, 56, 0.95);
  --cdg-a11y-control-hover: rgba(35, 58, 88, 0.98);
  --cdg-a11y-border: rgba(174, 195, 218, 0.34);
  --cdg-a11y-row: rgba(20, 36, 56, 0.9);
  --cdg-a11y-row-hover: rgba(47, 91, 136, 0.7);
  --cdg-a11y-table-bg: rgba(9, 20, 33, 0.94);
  --cdg-a11y-table-head: rgba(30, 48, 72, 0.96);
  --cdg-a11y-table-border: rgba(174, 195, 218, 0.34);
  --cdg-a11y-primary: #7fc2ff;
  --cdg-a11y-primary-strong: #b9ddff;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="system"],
  :root[data-theme="system"],
  body[data-theme="system"] {
    --text: #f5f7fb;
    --text-strong: #ffffff;
    --muted: #c6d5e6;
    --portal-text-muted: #c6d5e6;
    --text-muted: #c6d5e6;
    --app-text-muted: #c6d5e6;
    --table-head-bg: rgba(30, 48, 72, 0.96);
    --table-row-alt: rgba(20, 36, 56, 0.9);
    --table-row-hover: rgba(47, 91, 136, 0.7);
    --table-bg: rgba(9, 20, 33, 0.94);
    --table-border: rgba(174, 195, 218, 0.34);
    --table-cell-border: rgba(174, 195, 218, 0.24);
    --table-head-text: #f8fbff;
    --table-label: #dbe8f7;
    --input-bg: #0d1b2d;
    --input-border: rgba(190, 207, 226, 0.42);
    --input-placeholder: #c6d5e6;
    --status-success-bg: rgba(16, 185, 129, 0.2);
    --status-success-border: #34d399;
    --status-success-text: #d1fae5;
    --status-warning-bg: rgba(234, 179, 8, 0.2);
    --status-warning-border: #fbbf24;
    --status-warning-text: #fef3c7;
    --status-danger-bg: rgba(239, 68, 68, 0.18);
    --status-danger-border: #f87171;
    --status-danger-text: #fee2e2;
    --status-info-bg: rgba(59, 130, 246, 0.22);
    --status-info-border: #60a5fa;
    --status-info-text: #dbeafe;
    --status-muted-bg: rgba(148, 163, 184, 0.18);
    --status-muted-border: #94a3b8;
    --status-muted-text: #f1f5f9;
    --cdg-a11y-text: #f5f7fb;
    --cdg-a11y-strong: #ffffff;
    --cdg-a11y-muted: #c6d5e6;
    --cdg-a11y-surface: rgba(11, 22, 36, 0.94);
    --cdg-a11y-surface-soft: rgba(17, 32, 52, 0.96);
    --cdg-a11y-control: rgba(20, 36, 56, 0.95);
    --cdg-a11y-control-hover: rgba(35, 58, 88, 0.98);
    --cdg-a11y-border: rgba(174, 195, 218, 0.34);
    --cdg-a11y-row: rgba(20, 36, 56, 0.9);
    --cdg-a11y-row-hover: rgba(47, 91, 136, 0.7);
    --cdg-a11y-table-bg: rgba(9, 20, 33, 0.94);
    --cdg-a11y-table-head: rgba(30, 48, 72, 0.96);
    --cdg-a11y-table-border: rgba(174, 195, 218, 0.34);
    --cdg-a11y-primary: #7fc2ff;
    --cdg-a11y-primary-strong: #b9ddff;
  }
}

.muted,
.text-muted,
.text-secondary,
.text-body-secondary,
.hint,
.form-help,
.field-hint,
.input-help,
small,
label,
legend,
.card-header__meta,
.portal-section-head p,
.portal-apps-toolbar__meta,
.cdg-filter-summary,
.cdg-table-mode-label {
  color: var(--cdg-a11y-muted) !important;
}

strong,
h1,
h2,
h3,
h4,
.page-title,
.card-title {
  color: var(--cdg-a11y-strong);
}

table:not([role="presentation"]),
.portal-table,
.table,
.ha-table,
.facture-table,
.participants-table,
.votes-table {
  background: var(--cdg-a11y-table-bg) !important;
  border-color: var(--cdg-a11y-table-border) !important;
  color: var(--cdg-a11y-text) !important;
}

table:not([role="presentation"]) th,
table:not([role="presentation"]) td,
.portal-table th,
.portal-table td,
.table th,
.table td,
.ha-table th,
.ha-table td,
.facture-table th,
.facture-table td,
.participants-table th,
.participants-table td,
.votes-table th,
.votes-table td {
  border-color: var(--table-cell-border, var(--cdg-a11y-table-border)) !important;
  color: var(--cdg-a11y-text) !important;
}

table:not([role="presentation"]) thead th,
.portal-table thead th,
.table thead th,
.ha-table thead th,
.facture-table thead th,
.participants-table th,
.votes-table th {
  background: var(--cdg-a11y-table-head) !important;
  color: var(--table-head-text, var(--cdg-a11y-strong)) !important;
}

table:not([role="presentation"]) tbody tr:nth-child(odd),
.portal-table tbody tr:nth-child(odd),
.table-striped tbody tr:nth-of-type(odd),
.ha-table tbody tr:nth-child(odd),
.facture-table tbody tr:nth-child(odd) {
  background: var(--cdg-a11y-row) !important;
}

table:not([role="presentation"]) tbody tr:hover,
.portal-table tbody tr:hover,
.table-hover tbody tr:hover,
.table tbody tr:hover,
.ha-table tbody tr:hover,
.facture-table tbody tr:hover {
  background: var(--cdg-a11y-row-hover) !important;
}

.table-scroll,
.table-wrapper,
.table-responsive,
.cdg-table-scroll,
.app-table-wrapper,
.ha-participants-table-wrap,
.facture-history-table-wrap {
  background: var(--cdg-a11y-table-bg) !important;
  border-color: var(--cdg-a11y-table-border) !important;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select,
textarea,
.form-control,
.form-select {
  background: var(--input-bg, var(--cdg-a11y-surface)) !important;
  border-color: var(--input-border, var(--cdg-a11y-border)) !important;
  color: var(--cdg-a11y-text) !important;
}

input::placeholder,
textarea::placeholder {
  color: var(--input-placeholder, var(--cdg-a11y-muted)) !important;
  opacity: 1;
}

.btn-secondary,
a.btn.btn-secondary,
button.btn-secondary,
.btn-muted,
a.btn.btn-muted,
button.btn-muted,
.btn-outline,
a.btn.btn-outline,
button.btn-outline,
.portal-tabs a,
.section-nav a,
.admin-quick-link,
.subtab,
.tab-link,
.filter,
.view-tab,
.ha-filter-pill,
.ha-form-tab,
.ha-space-tab,
.ha-insight-switch,
.ha-page-link,
.folder-item,
.msg-item {
  background: var(--cdg-a11y-control) !important;
  border-color: var(--cdg-a11y-border) !important;
  color: var(--cdg-a11y-text) !important;
}

.btn-secondary:hover,
a.btn.btn-secondary:hover,
button.btn-secondary:hover,
.btn-muted:hover,
a.btn.btn-muted:hover,
button.btn-muted:hover,
.btn-outline:hover,
a.btn.btn-outline:hover,
button.btn-outline:hover,
.portal-tabs a:hover,
.portal-tabs a:focus-visible,
.section-nav a:hover,
.section-nav a:focus-visible,
.admin-quick-link:hover,
.admin-quick-link:focus-visible,
.subtab:hover,
.tab-link:hover,
.filter:hover,
.view-tab:hover,
.ha-filter-pill:hover,
.ha-form-tab:hover,
.ha-space-tab:hover,
.ha-insight-switch:hover,
.ha-page-link:hover,
.folder-item:hover,
.msg-item:hover {
  background: var(--cdg-a11y-control-hover) !important;
  border-color: var(--cdg-a11y-primary) !important;
  color: var(--cdg-a11y-strong) !important;
}

/* Notifications + HelloAsso: final guard for light-mode buttons and flash messages. */
:is(html[data-theme="light"], html[data-theme-effective="light"]) :is(body.notifications-page, body.ha-body),
:is(body.theme-light.notifications-page, body[data-theme-effective="light"].notifications-page, body[data-theme="light"]:not(.dark-mode).notifications-page, body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) {
  --cdg-button-primary-bg: #1267c2;
  --cdg-button-primary-hover: #0d4f9e;
  --cdg-button-primary-text: #ffffff;
  --cdg-button-primary-border: #0d4f9e;
  --cdg-button-secondary-bg: #e4eef8;
  --cdg-button-secondary-hover: #d7e7f5;
  --cdg-button-secondary-text: #102133;
  --cdg-button-secondary-border: #8eaac8;
  --cdg-button-danger-bg: #b42318;
  --cdg-button-danger-hover: #991b1b;
  --cdg-button-danger-text: #ffffff;
  --cdg-button-danger-border: #b42318;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) :is(body.notifications-page, body.ha-body) :is(.btn, button:not(.portal-link), input[type="submit"], summary.btn),
:is(body.theme-light.notifications-page, body[data-theme-effective="light"].notifications-page, body[data-theme="light"]:not(.dark-mode).notifications-page, body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) :is(.btn, button:not(.portal-link), input[type="submit"], summary.btn) {
  background: var(--cdg-button-primary-bg) !important;
  border-color: var(--cdg-button-primary-border) !important;
  color: var(--cdg-button-primary-text) !important;
  text-shadow: none !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) :is(body.notifications-page, body.ha-body) :is(.btn:hover, .btn:focus-visible, button:not(.portal-link):hover, button:not(.portal-link):focus-visible, input[type="submit"]:hover, input[type="submit"]:focus-visible, summary.btn:hover, summary.btn:focus-visible),
:is(body.theme-light.notifications-page, body[data-theme-effective="light"].notifications-page, body[data-theme="light"]:not(.dark-mode).notifications-page, body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) :is(.btn:hover, .btn:focus-visible, button:not(.portal-link):hover, button:not(.portal-link):focus-visible, input[type="submit"]:hover, input[type="submit"]:focus-visible, summary.btn:hover, summary.btn:focus-visible) {
  background: var(--cdg-button-primary-hover) !important;
  border-color: var(--cdg-button-primary-border) !important;
  color: var(--cdg-button-primary-text) !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) :is(body.notifications-page, body.ha-body) :is(.btn-secondary, .btn-muted, .btn-outline, .btn-ghost, summary.btn-muted, summary.btn-secondary, .action-menu__toggle),
:is(body.theme-light.notifications-page, body[data-theme-effective="light"].notifications-page, body[data-theme="light"]:not(.dark-mode).notifications-page, body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) :is(.btn-secondary, .btn-muted, .btn-outline, .btn-ghost, summary.btn-muted, summary.btn-secondary, .action-menu__toggle) {
  background: var(--cdg-button-secondary-bg) !important;
  border-color: var(--cdg-button-secondary-border) !important;
  color: var(--cdg-button-secondary-text) !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) :is(body.notifications-page, body.ha-body) :is(.btn-secondary:hover, .btn-secondary:focus-visible, .btn-muted:hover, .btn-muted:focus-visible, .btn-outline:hover, .btn-outline:focus-visible, .btn-ghost:hover, .btn-ghost:focus-visible, summary.btn-muted:hover, summary.btn-muted:focus-visible, summary.btn-secondary:hover, summary.btn-secondary:focus-visible, .action-menu__toggle:hover, .action-menu__toggle:focus-visible),
:is(body.theme-light.notifications-page, body[data-theme-effective="light"].notifications-page, body[data-theme="light"]:not(.dark-mode).notifications-page, body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) :is(.btn-secondary:hover, .btn-secondary:focus-visible, .btn-muted:hover, .btn-muted:focus-visible, .btn-outline:hover, .btn-outline:focus-visible, .btn-ghost:hover, .btn-ghost:focus-visible, summary.btn-muted:hover, summary.btn-muted:focus-visible, summary.btn-secondary:hover, summary.btn-secondary:focus-visible, .action-menu__toggle:hover, .action-menu__toggle:focus-visible) {
  background: var(--cdg-button-secondary-hover) !important;
  border-color: var(--cdg-button-primary-border) !important;
  color: #061424 !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) :is(body.notifications-page, body.ha-body) :is(.btn.btn-danger, button.btn-danger, a.btn-danger),
:is(body.theme-light.notifications-page, body[data-theme-effective="light"].notifications-page, body[data-theme="light"]:not(.dark-mode).notifications-page, body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) :is(.btn.btn-danger, button.btn-danger, a.btn-danger) {
  background: var(--cdg-button-danger-bg) !important;
  border-color: var(--cdg-button-danger-border) !important;
  color: var(--cdg-button-danger-text) !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) :is(body.notifications-page, body.ha-body) :is(.btn.btn-danger, button.btn-danger, a.btn-danger):is(:hover, :focus-visible),
:is(body.theme-light.notifications-page, body[data-theme-effective="light"].notifications-page, body[data-theme="light"]:not(.dark-mode).notifications-page, body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) :is(.btn.btn-danger, button.btn-danger, a.btn-danger):is(:hover, :focus-visible) {
  background: var(--cdg-button-danger-hover) !important;
  border-color: var(--cdg-button-danger-border) !important;
  color: var(--cdg-button-danger-text) !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.notifications-page :is(.card, .notif-group, .notif-card, .action-menu__panel),
:is(body.theme-light.notifications-page, body[data-theme-effective="light"].notifications-page, body[data-theme="light"]:not(.dark-mode).notifications-page) :is(.card, .notif-group, .notif-card, .action-menu__panel) {
  background: #ffffff !important;
  border-color: #9fb7cf !important;
  color: #102133 !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.notifications-page .notif-card--unread,
:is(body.theme-light.notifications-page, body[data-theme-effective="light"].notifications-page, body[data-theme="light"]:not(.dark-mode).notifications-page) .notif-card--unread {
  background: #eff6ff !important;
  border-color: #2563eb !important;
  box-shadow: inset 4px 0 0 #2563eb, 0 8px 22px rgba(18, 38, 63, 0.08) !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.notifications-page .notif-card--snoozed,
:is(body.theme-light.notifications-page, body[data-theme-effective="light"].notifications-page, body[data-theme="light"]:not(.dark-mode).notifications-page) .notif-card--snoozed {
  background: #fff7ed !important;
  border-color: #d97706 !important;
  color: #7c2d12 !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) :is(body.notifications-page, body.ha-body) .ok,
:is(body.theme-light.notifications-page, body[data-theme-effective="light"].notifications-page, body[data-theme="light"]:not(.dark-mode).notifications-page, body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) .ok {
  background: #ecfdf5 !important;
  border-color: #059669 !important;
  color: #166534 !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) :is(body.notifications-page, body.ha-body) .warn,
:is(body.theme-light.notifications-page, body[data-theme-effective="light"].notifications-page, body[data-theme="light"]:not(.dark-mode).notifications-page, body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) .warn {
  background: #fff7ed !important;
  border-color: #d97706 !important;
  color: #854d0e !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) :is(body.notifications-page, body.ha-body) .err,
:is(body.theme-light.notifications-page, body[data-theme-effective="light"].notifications-page, body[data-theme="light"]:not(.dark-mode).notifications-page, body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) .err {
  background: #fef2f2 !important;
  border-color: #dc2626 !important;
  color: #991b1b !important;
}

.portal-tabs a.active,
.portal-tabs a[aria-current="page"],
.section-nav a.active,
.section-nav a[aria-current="page"],
.admin-quick-link.is-active,
.admin-quick-link[aria-current="page"],
.subtab.active,
.tab-link.active,
.filter.active,
.view-tab.active,
.ha-filter-pill.is-active,
.ha-form-tab.is-active,
.ha-space-tab.is-active,
.ha-insight-switch.is-active,
.folder-item.active,
.msg-item.active {
  background: var(--status-info-bg, #eff6ff) !important;
  border-color: var(--status-info-border, var(--cdg-a11y-primary)) !important;
  color: var(--status-info-text, var(--cdg-a11y-primary-strong)) !important;
  box-shadow: inset 0 0 0 1px rgba(18, 103, 194, 0.12) !important;
}

.badge,
.chip,
.pill,
.app-chip,
.badge-soft,
.status-pill,
.ha-badge,
.invoice-status,
.participants-compact-rsvp,
.task-status,
.task-priority,
.subv-status {
  border-color: var(--cdg-a11y-border) !important;
  color: var(--cdg-a11y-text) !important;
}

html[data-theme="light"] .badge,
html[data-theme="light"] .chip,
html[data-theme="light"] .pill,
html[data-theme="light"] .app-chip,
html[data-theme="light"] .ha-badge,
html[data-theme="light"] .invoice-status,
html[data-theme="light"] .participants-compact-rsvp,
html[data-theme="light"] .task-status,
html[data-theme="light"] .task-priority,
html[data-theme="light"] .subv-status {
  background: #eef4fb !important;
  color: #273f59 !important;
}

html[data-theme="light"] .ok,
html[data-theme="light"] .alert-success,
html[data-theme="light"] .badge--success,
html[data-theme="light"] .status-pill--success,
html[data-theme="light"] .badge-soft--success,
html[data-theme="light"] .ha-badge--success,
html[data-theme="light"] .invoice-status--paid,
html[data-theme="light"] .invoice-status--sent {
  background: #ecfdf5 !important;
  border-color: #059669 !important;
  color: #166534 !important;
}

html[data-theme="light"] .warn,
html[data-theme="light"] .alert-warning,
html[data-theme="light"] .badge--warning,
html[data-theme="light"] .status-pill--warning,
html[data-theme="light"] .badge-soft--warning,
html[data-theme="light"] .ha-badge--warning,
html[data-theme="light"] .invoice-status--draft,
html[data-theme="light"] .invoice-status--pending {
  background: #fff7ed !important;
  border-color: #d97706 !important;
  color: #854d0e !important;
}

html[data-theme="light"] .err,
html[data-theme="light"] .alert-danger,
html[data-theme="light"] .alert-error,
html[data-theme="light"] .badge--danger,
html[data-theme="light"] .status-pill--danger,
html[data-theme="light"] .badge-soft--danger,
html[data-theme="light"] .ha-badge--danger,
html[data-theme="light"] .invoice-status--error,
html[data-theme="light"] .invoice-status--late {
  background: #fef2f2 !important;
  border-color: #dc2626 !important;
  color: #991b1b !important;
}

html[data-theme="light"] .badge.bg-success,
html[data-theme="light"] .badge.text-bg-success,
html[data-theme="light"] .text-bg-success {
  background: #ecfdf5 !important;
  background-image: none !important;
  border-color: #059669 !important;
  color: #166534 !important;
}

html[data-theme="light"] .badge.bg-primary,
html[data-theme="light"] .badge.text-bg-primary,
html[data-theme="light"] .text-bg-primary,
html[data-theme="light"] .badge.bg-info,
html[data-theme="light"] .badge.text-bg-info,
html[data-theme="light"] .text-bg-info {
  background: #eff6ff !important;
  background-image: none !important;
  border-color: #2563eb !important;
  color: #1d4ed8 !important;
}

html[data-theme="light"] .badge.bg-warning,
html[data-theme="light"] .badge.text-bg-warning,
html[data-theme="light"] .text-bg-warning {
  background: #fff7ed !important;
  background-image: none !important;
  border-color: #d97706 !important;
  color: #854d0e !important;
}

html[data-theme="light"] .badge.bg-danger,
html[data-theme="light"] .badge.text-bg-danger,
html[data-theme="light"] .text-bg-danger {
  background: #fef2f2 !important;
  background-image: none !important;
  border-color: #dc2626 !important;
  color: #991b1b !important;
}

html[data-theme="light"] .badge.bg-secondary,
html[data-theme="light"] .badge.text-bg-secondary,
html[data-theme="light"] .text-bg-secondary,
html[data-theme="light"] .badge.bg-light,
html[data-theme="light"] .badge.text-bg-light,
html[data-theme="light"] .text-bg-light {
  background: #f1f5f9 !important;
  background-image: none !important;
  border-color: #94a3b8 !important;
  color: #334155 !important;
}

html[data-theme="dark"] .badge.bg-secondary,
html[data-theme="dark"] .badge.text-bg-secondary,
html[data-theme="dark"] .text-bg-secondary,
html[data-theme="dark"] .badge.bg-light,
html[data-theme="dark"] .badge.text-bg-light,
html[data-theme="dark"] .text-bg-light {
  background: #334155 !important;
  background-image: none !important;
  border-color: #94a3b8 !important;
  color: #f8fafc !important;
}

html[data-theme="light"] .admin-nav-shell {
  background: linear-gradient(135deg, #ffffff, #edf4fb) !important;
  border-color: #9fb7cf !important;
  color: #102133 !important;
}

html[data-theme="light"] .admin-nav-shell__title strong {
  color: #061424 !important;
}

html[data-theme="light"] .admin-nav-shell__eyebrow {
  color: #8a4f10 !important;
}

html[data-theme="light"] .portal-tabs--admin a {
  background: #dfeaf5 !important;
  border-color: #9fb7cf !important;
  color: #24405a !important;
}

html[data-theme="light"] .portal-tabs--admin a.active,
html[data-theme="light"] .portal-tabs--admin a[aria-current="page"],
html[data-theme="light"] .admin-quick-link.is-active,
html[data-theme="light"] .admin-quick-link[aria-current="page"] {
  background: #dff7ef !important;
  border-color: #059669 !important;
  color: #075e54 !important;
}

html[data-theme="light"] .admin-nav-shell__quick > span,
html[data-theme="light"] .admin-nav-empty {
  color: #334a62 !important;
}

body .portal-bar,
html[data-theme="light"] body.app-layout .portal-bar,
html[data-theme="dark"] body.app-layout .portal-bar {
  --portalbar-link-text: #eef6ff;
  --portalbar-link-text-hover: #ffffff;
  --portalbar-link-bg: rgba(15, 24, 52, 0.58);
  --portalbar-link-bg-hover: rgba(82, 124, 255, 0.28);
  --portalbar-link-border: rgba(190, 207, 226, 0.42);
  --portalbar-link-border-hover: rgba(219, 234, 254, 0.78);
  background-color: #08121e !important;
}

body .portal-bar .portal-icon {
  background: #1b2a44 !important;
  border-color: rgba(226, 232, 240, 0.46) !important;
  color: #f8fafc !important;
}

body .portal-bar :is(.portal-link:hover, .portal-link:focus-visible, .portal-menu[open] > summary.portal-link) .portal-icon {
  background: #1e4073 !important;
  border-color: rgba(219, 234, 254, 0.76) !important;
  color: #ffffff !important;
}

body .portal-bar .portal-theme-picker__select,
body .portal-bar .portal-edition__select {
  background: #111c2e !important;
  border-color: rgba(190, 207, 226, 0.46) !important;
  color: #f8fafc !important;
}

body .portal-bar .portal-theme-picker__select option,
body .portal-bar .portal-edition__select option {
  background: #111c2e !important;
  color: #f8fafc !important;
}

html[data-theme="light"] .ha-body,
html[data-theme="light"] body.ha-body,
html[data-theme="light"] body.part-body,
html[data-theme="light"] body.reunions-body,
html[data-theme="light"] .wrap--accred {
  --muted: #40566f;
  --text-muted: #40566f;
  --portal-text-muted: #40566f;
  --ha-readable-muted: #40566f;
  color: #102133;
}

html[data-theme="light"] .ha-body .ha-table-tools,
html[data-theme="light"] .ha-body .ha-table-count,
html[data-theme="light"] .ha-body .ha-table-legend,
html[data-theme="light"] .ha-body .ha-stat-card,
html[data-theme="light"] .ha-body .ha-chart-card,
html[data-theme="light"] .part-body .card,
html[data-theme="light"] .part-page-meta__item,
html[data-theme="light"] .part-filter-pill,
html[data-theme="light"] .part-quick-actions a,
html[data-theme="light"] .webmail-panel,
html[data-theme="light"] .wm-thread,
html[data-theme="light"] .wm-ged-item,
html[data-theme="light"] .subv-kpi-card,
html[data-theme="light"] .subv-kanban__column,
html[data-theme="light"] .subv-kanban__card,
html[data-theme="light"] .ged-summary-item,
html[data-theme="light"] .ged-detail-block,
html[data-theme="light"] .accred-page-head,
html[data-theme="light"] .accred-create-progress__item,
html[data-theme="light"] .accred-source-tab {
  background: var(--cdg-a11y-surface-soft) !important;
  border-color: var(--cdg-a11y-border) !important;
  color: var(--cdg-a11y-text) !important;
}

html[data-theme="light"] .ha-body .muted,
html[data-theme="light"] .ha-body small,
html[data-theme="light"] .part-body .muted,
html[data-theme="light"] .part-body small,
html[data-theme="light"] .webmail-panel small,
html[data-theme="light"] .preview-meta,
html[data-theme="light"] .wrap--accred .muted,
html[data-theme="light"] .wrap--accred small {
  color: #40566f !important;
}

@media (max-width: 720px) {
  table[data-mobile-cards="1"] tr,
  table[data-mobile-cards="force"] tr,
  table[data-table-mode="cards"] tr,
  table.cdg-table-mode-cards tr,
  body.app-layout table.cdg-table-cards tbody tr,
  .ha-body .ha-table:is([data-mobile-cards="1"], [data-mobile-cards="force"], [data-mobile-cards="auto"]) tr {
    background: var(--cdg-a11y-surface) !important;
    border-color: var(--cdg-a11y-border) !important;
    color: var(--cdg-a11y-text) !important;
  }

  table[data-mobile-cards="1"] td::before,
  table[data-mobile-cards="force"] td::before,
  table[data-table-mode="cards"] td::before,
  table.cdg-table-mode-cards td::before,
  body.app-layout table.cdg-table-cards tbody td::before,
  .ha-body .ha-table:is([data-mobile-cards="1"], [data-mobile-cards="force"], [data-mobile-cards="auto"]) td::before {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden !important;
    overflow-wrap: normal !important;
    text-overflow: ellipsis;
    white-space: nowrap !important;
    word-break: normal !important;
    color: var(--cdg-a11y-muted) !important;
    letter-spacing: 0;
  }
}

@media (max-width: 520px) {
  table[data-mobile-cards="force"] td,
  table[data-table-mode="cards"] td,
  table.cdg-table-mode-cards td,
  body.app-layout table.cdg-table-cards tbody td,
  .ha-body .ha-table:is([data-mobile-cards="1"], [data-mobile-cards="force"], [data-mobile-cards="auto"]) td {
    grid-template-columns: 1fr !important;
    gap: 4px;
  }
}

/* Theme cascade aliases for legacy pages that set the mode on body or only expose an effective theme. */
:is(html[data-theme-effective="light"], body.theme-light, body[data-theme-effective="light"], body[data-theme="light"]:not(.dark-mode)) :is(.badge, .chip, .pill, .app-chip, .ha-badge, .badge-chip, .status-badge, .accred-kpi-card__chip, .accred-quick-stat, .accred-filter-chip, .accred-control-pill, .accred-flag, .invoice-status, .participants-compact-rsvp, .task-status, .task-priority, .subv-status) {
  background: #eef4fb !important;
  color: #273f59 !important;
}

:is(html[data-theme-effective="light"], body.theme-light, body[data-theme-effective="light"], body[data-theme="light"]:not(.dark-mode)) :is(.ok, .alert-success, .badge--success, .status-pill--success, .badge-soft--success, .ha-badge--success, .invoice-status--paid, .invoice-status--sent, .badge.bg-success, .badge.text-bg-success, .text-bg-success) {
  background: #ecfdf5 !important;
  background-image: none !important;
  border-color: #059669 !important;
  color: #166534 !important;
}

:is(html[data-theme-effective="light"], body.theme-light, body[data-theme-effective="light"], body[data-theme="light"]:not(.dark-mode)) :is(.warn, .alert-warning, .badge--warning, .status-pill--warning, .badge-soft--warning, .ha-badge--warning, .invoice-status--draft, .invoice-status--pending, .badge.bg-warning, .badge.text-bg-warning, .text-bg-warning) {
  background: #fff7ed !important;
  background-image: none !important;
  border-color: #d97706 !important;
  color: #854d0e !important;
}

:is(html[data-theme-effective="light"], body.theme-light, body[data-theme-effective="light"], body[data-theme="light"]:not(.dark-mode)) :is(.err, .alert-danger, .alert-error, .badge--danger, .status-pill--danger, .badge-soft--danger, .ha-badge--danger, .invoice-status--error, .invoice-status--late, .badge.bg-danger, .badge.text-bg-danger, .text-bg-danger) {
  background: #fef2f2 !important;
  background-image: none !important;
  border-color: #dc2626 !important;
  color: #991b1b !important;
}

:is(html[data-theme-effective="light"], body.theme-light, body[data-theme-effective="light"], body[data-theme="light"]:not(.dark-mode)) :is(.badge.bg-primary, .badge.text-bg-primary, .text-bg-primary, .badge.bg-info, .badge.text-bg-info, .text-bg-info) {
  background: #eff6ff !important;
  background-image: none !important;
  border-color: #2563eb !important;
  color: #1d4ed8 !important;
}

:is(html[data-theme-effective="light"], body.theme-light, body[data-theme-effective="light"], body[data-theme="light"]:not(.dark-mode)) :is(.badge.bg-secondary, .badge.text-bg-secondary, .text-bg-secondary, .badge.bg-light, .badge.text-bg-light, .text-bg-light) {
  background: #f1f5f9 !important;
  background-image: none !important;
  border-color: #94a3b8 !important;
  color: #334155 !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"], body.theme-light, body[data-theme-effective="light"], body[data-theme="light"]:not(.dark-mode)) :is(.portal-stat span, .portal-command-center .portal-stat span) {
  color: #334a62 !important;
  font-weight: 800;
}

@media (max-width: 860px) {
  body .portal-mobile-dock__icon {
    border: 1px solid rgba(226, 232, 240, 0.26);
    color: currentColor;
  }

  :is(html[data-theme="light"], html[data-theme-effective="light"], body.theme-light, body[data-theme-effective="light"], body[data-theme="light"]:not(.dark-mode)) .portal-mobile-dock__icon {
    background: #e8f1fb !important;
    border-color: #9fb7cf !important;
    color: #193653 !important;
  }

  :is(html[data-theme="light"], html[data-theme-effective="light"], body.theme-light, body[data-theme-effective="light"], body[data-theme="light"]:not(.dark-mode)) :is(.portal-mobile-dock__item.is-active, .portal-mobile-dock__item[aria-current="page"]) .portal-mobile-dock__icon {
    background: #dff7f3 !important;
    border-color: #11836e !important;
    color: #064e3b !important;
  }

  :is(html[data-theme="dark"], html[data-theme-effective="dark"], body.theme-dark, body[data-theme-effective="dark"], body[data-theme="dark"], body.dark-mode) .portal-mobile-dock__icon {
    background: #233650 !important;
    border-color: rgba(226, 232, 240, 0.34) !important;
    color: #eef6ff !important;
  }

  :is(html[data-theme="dark"], html[data-theme-effective="dark"], body.theme-dark, body[data-theme-effective="dark"], body[data-theme="dark"], body.dark-mode) :is(.portal-mobile-dock__item.is-active, .portal-mobile-dock__item[aria-current="page"]) .portal-mobile-dock__icon {
    background: #164e63 !important;
    border-color: rgba(165, 243, 252, 0.62) !important;
    color: #ecfeff !important;
  }
}

:is(html[data-theme="dark"], html[data-theme-effective="dark"], body.theme-dark, body[data-theme-effective="dark"], body[data-theme="dark"], body.dark-mode) :is(.badge.bg-secondary, .badge.text-bg-secondary, .text-bg-secondary, .badge.bg-light, .badge.text-bg-light, .text-bg-light, .bg-light, .bg-white, .table-light, .table-secondary) {
  background: #334155 !important;
  background-image: none !important;
  border-color: #94a3b8 !important;
  color: #f8fafc !important;
}

:is(html[data-theme="dark"], html[data-theme-effective="dark"], body.theme-dark, body[data-theme-effective="dark"], body[data-theme="dark"], body.dark-mode) :is(.text-dark, .link-dark) {
  color: #f8fafc !important;
}

:is(html[data-theme-effective="light"], body.theme-light, body[data-theme-effective="light"], body[data-theme="light"]:not(.dark-mode)) .admin-nav-shell {
  background: linear-gradient(135deg, #ffffff, #edf4fb) !important;
  border-color: #9fb7cf !important;
  color: #102133 !important;
}

:is(html[data-theme-effective="light"], body.theme-light, body[data-theme-effective="light"], body[data-theme="light"]:not(.dark-mode)) .portal-tabs--admin a {
  background: #dfeaf5 !important;
  border-color: #9fb7cf !important;
  color: #24405a !important;
}

:is(html[data-theme-effective="light"], body.theme-light, body[data-theme-effective="light"], body[data-theme="light"]:not(.dark-mode)) :is(.portal-tabs--admin a.active, .portal-tabs--admin a[aria-current="page"], .admin-quick-link.is-active, .admin-quick-link[aria-current="page"]) {
  background: #dff7ef !important;
  border-color: #059669 !important;
  color: #075e54 !important;
}

body.theme-light.ha-body,
body.theme-light.part-body,
body.theme-light.reunions-body,
body[data-theme-effective="light"].ha-body,
body[data-theme-effective="light"].part-body,
body[data-theme-effective="light"].reunions-body,
body[data-theme="light"]:not(.dark-mode).ha-body,
body[data-theme="light"]:not(.dark-mode).part-body,
body[data-theme="light"]:not(.dark-mode).reunions-body {
  --muted: #40566f;
  --text-muted: #40566f;
  --portal-text-muted: #40566f;
  --ha-readable-muted: #40566f;
  color: #102133;
}

:is(body.theme-light, body[data-theme-effective="light"], body[data-theme="light"]:not(.dark-mode)) :is(.ha-body .muted, .ha-body small, .part-body .muted, .part-body small, .webmail-panel small, .preview-meta, .wrap--accred .muted, .wrap--accred small) {
  color: #40566f !important;
}

body.theme-light.ha-body :is(.muted, small),
body.theme-light.part-body :is(.muted, small),
body[data-theme-effective="light"].ha-body :is(.muted, small),
body[data-theme-effective="light"].part-body :is(.muted, small),
body[data-theme="light"]:not(.dark-mode).ha-body :is(.muted, small),
body[data-theme="light"]:not(.dark-mode).part-body :is(.muted, small) {
  color: #40566f !important;
}

/* Cross-module final bridge: light theme must never keep dark legacy panels with dark text. */
:is(html[data-theme-effective="light"], body.theme-light, body[data-theme-effective="light"], body[data-theme="light"]:not(.dark-mode)) :is(
  .card:not(.badge-card),
  .cdg-card,
  .cdg-shell-card,
  .app-panel,
  .app-table-wrapper,
  .dashboard-kpi-card,
  .portal-card,
  .portal-dashboard-card,
  .portal-app-card,
  .ged-summary-item,
  .ged-detail-block,
  .folder-item,
  .msg-item,
  .wm-thread,
  .wm-attachment,
  .webmail-panel,
  .subv-kpi-card,
  .subv-kanban__column,
  .subv-kanban__card,
  .part-page-meta__item,
  .part-filter-pill,
  .part-quick-actions a,
  .reunions-body .meeting-row,
  .reunions-body .comment-row,
  .reunions-body .task-comment-summary,
  .reunions-body .poll-block,
  .reunions-body .mytasks-group,
  .reunions-body .files li,
  .reunions-body .tasks li,
  .wrap--accred .accred-page-head,
  .wrap--accred .accred-kpi-card,
  .wrap--accred .accred-bars__row,
  .wrap--accred .stack-list__item,
  .wrap--accred .bulk-toolbar,
  .wrap--accred .bulk-confirm,
  .wrap--accred .fieldset,
  .wrap--accred details.full,
  .wrap--accred .accred-create-progress__item,
  .wrap--accred .accred-source-tab,
  .wrap--accred .accred-source-hub,
  .wrap--accred .accred-create-step,
  .wrap--accred .accred-search-result,
  .wrap--accred .accred-photo-dropzone,
  .wrap--accred .accred-validation-box,
  .wrap--accred .accred-mini-badge,
  .wrap--accred .badge-preview__surface:not(.badge-preview__surface--export),
  .wrap--accred .trombi-card,
  .wrap--accred .cropper-modal__dialog,
  .wrap--accred .cropper-modal__preview
) {
  background: var(--cdg-a11y-surface) !important;
  background-image: none !important;
  border-color: var(--cdg-a11y-border) !important;
  color: var(--cdg-a11y-text) !important;
}

:is(html[data-theme-effective="light"], body.theme-light, body[data-theme-effective="light"], body[data-theme="light"]:not(.dark-mode)) :is(
  .card:not(.badge-card),
  .cdg-card,
  .cdg-shell-card,
  .app-panel,
  .dashboard-kpi-card,
  .portal-card,
  .wrap--accred .accred-kpi-card,
  .wrap--accred .accred-bars__row,
  .wrap--accred .stack-list__item,
  .wrap--accred .trombi-card
) :is(h1, h2, h3, h4, strong, b, .page-title, .cdg-empty-state__title, .accred-kpi-card__label, .accred-kpi-card__value, .trombi-card__name) {
  color: var(--cdg-a11y-strong) !important;
}

:is(html[data-theme-effective="light"], body.theme-light, body[data-theme-effective="light"], body[data-theme="light"]:not(.dark-mode)) :is(
  .card:not(.badge-card),
  .cdg-card,
  .cdg-shell-card,
  .app-panel,
  .dashboard-kpi-card,
  .portal-card,
  .wrap--accred .accred-kpi-card,
  .wrap--accred .accred-bars__row,
  .wrap--accred .stack-list__item,
  .wrap--accred .trombi-card
) :is(p, li, small, .muted, .page-desc, .cdg-empty-state__hint, .accred-kpi-card__eyebrow, .accred-kpi-card__caption, .accred-kpi-card__hint, .trombi-card__category, .trombi-card__meta, .trombi-card__code) {
  color: var(--cdg-a11y-muted) !important;
}

:is(html[data-theme-effective="light"], body.theme-light, body[data-theme-effective="light"], body[data-theme="light"]:not(.dark-mode)) .wrap--accred .accred-bars__meter {
  background: #c7d5e6 !important;
}

:is(html[data-theme-effective="light"], body.theme-light, body[data-theme-effective="light"], body[data-theme="light"]:not(.dark-mode)) .wrap--accred .accred-kpi-card__icon {
  background: #dbeafe !important;
  border-color: #8fb2d8 !important;
  box-shadow: none !important;
}

:is(html[data-theme-effective="light"], body.theme-light, body[data-theme-effective="light"], body[data-theme="light"]:not(.dark-mode)) .wrap--accred :is(.accred-kpi-card__chip, .accred-quick-stat, .accred-filter-chip, .accred-control-pill, .accred-flag, .badge-chip, .status-badge) {
  background: #e4eef8 !important;
  background-image: none !important;
  border-color: #9fb7cf !important;
  color: #273f59 !important;
}

:is(html[data-theme="dark"], html[data-theme-effective="dark"], body.theme-dark, body[data-theme-effective="dark"], body[data-theme="dark"], body.dark-mode) :is(
  .card:not(.badge-card),
  .cdg-card,
  .cdg-shell-card,
  .app-panel,
  .dashboard-kpi-card,
  .portal-card,
  .wrap--accred .accred-kpi-card,
  .wrap--accred .accred-bars__row,
  .wrap--accred .stack-list__item,
  .wrap--accred .trombi-card
) {
  border-color: var(--cdg-a11y-border) !important;
  color: var(--cdg-a11y-text) !important;
}

:is(html[data-theme="dark"], html[data-theme-effective="dark"], body.theme-dark, body[data-theme-effective="dark"], body[data-theme="dark"], body.dark-mode) :is(
  .card:not(.badge-card),
  .cdg-card,
  .cdg-shell-card,
  .app-panel,
  .dashboard-kpi-card,
  .portal-card,
  .wrap--accred .accred-kpi-card,
  .wrap--accred .accred-bars__row,
  .wrap--accred .stack-list__item,
  .wrap--accred .trombi-card
) :is(h1, h2, h3, h4, strong, b, .page-title, .cdg-empty-state__title, .accred-kpi-card__label, .accred-kpi-card__value, .trombi-card__name) {
  color: var(--cdg-a11y-strong) !important;
}

:is(html[data-theme="dark"], html[data-theme-effective="dark"], body.theme-dark, body[data-theme-effective="dark"], body[data-theme="dark"], body.dark-mode) :is(
  .card:not(.badge-card),
  .cdg-card,
  .cdg-shell-card,
  .app-panel,
  .dashboard-kpi-card,
  .portal-card,
  .wrap--accred .accred-kpi-card,
  .wrap--accred .accred-bars__row,
  .wrap--accred .stack-list__item,
  .wrap--accred .trombi-card
) :is(p, li, small, .muted, .page-desc, .cdg-empty-state__hint, .accred-kpi-card__eyebrow, .accred-kpi-card__caption, .accred-kpi-card__hint, .trombi-card__category, .trombi-card__meta, .trombi-card__code) {
  color: var(--cdg-a11y-muted) !important;
}

/* HelloAsso final contrast bridge: these surfaces mix historical dark panels with theme-driven text. */
body.ha-body :is(.ha-edition-context, .ha-insights article, .ha-tab-group, .ha-stat-group, .ha-stat-card, .ha-chart-card, .ha-table-tools, .ha-table-count, .ha-quality-action, .ha-cockpit-card, .ha-report-ready-card, .ha-empty-state) {
  background: var(--cdg-a11y-surface-soft) !important;
  border-color: var(--cdg-a11y-border) !important;
  color: var(--cdg-a11y-text) !important;
}

body.ha-body .ha-tab-group.is-active {
  border-color: var(--status-info-border, var(--cdg-a11y-primary)) !important;
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.16) !important;
}

body.ha-body :is(.ha-edition-context strong, .ha-insights h2, .ha-tab-group__title strong, .ha-stat-group__head h3, .ha-stat-card strong, .ha-chart-head h3, .ha-quality-action strong, .ha-cockpit-card strong, .ha-report-ready-card strong, .ha-empty-state strong) {
  color: var(--cdg-a11y-strong) !important;
}

body.ha-body :is(.ha-edition-context, .ha-edition-context small, .ha-insights li, .ha-tab-group__title small, .ha-stat-group__head p, .ha-stat-card span, .ha-stat-card small, .ha-quality-action span, .ha-quality-action small, .ha-cockpit-card span, .ha-cockpit-card small, .ha-report-ready-card span, .ha-report-ready-card small, .ha-chart-head small, .ha-empty-state p) {
  color: var(--cdg-a11y-muted) !important;
}

body.ha-body :is(.ha-stat-card em, .ha-kpi em) {
  color: var(--cdg-a11y-primary-strong) !important;
}

body.ha-body .ha-hero {
  color: #f8fbff !important;
}

body.ha-body .ha-hero :is(h1, h2, h3, strong, .ha-big-amount) {
  color: #ffffff !important;
}

body.ha-body .ha-hero :is(p, .muted, small) {
  color: #dbeafe !important;
}

/* Broader portal/app audit fixes. Keep these last so shared light-mode text rules cannot leak into dark surfaces. */
body.app-layout .portal-bar :is(.portal-bar__brand, .portal-bar__brand strong, .portal-bar__brand span, .portal-bar__title, .portal-bar__subtitle) {
  color: #f8fafc !important;
}

:is(html[data-theme-effective="light"], body.theme-light, body[data-theme-effective="light"], body[data-theme="light"]:not(.dark-mode)) .activity-card {
  background: var(--cdg-a11y-surface) !important;
  background-image: none !important;
  border-color: var(--cdg-a11y-border) !important;
  color: var(--cdg-a11y-text) !important;
}

:is(html[data-theme-effective="light"], body.theme-light, body[data-theme-effective="light"], body[data-theme="light"]:not(.dark-mode)) .activity-card :is(.activity-card__title, strong, b) {
  color: var(--cdg-a11y-strong) !important;
}

:is(html[data-theme-effective="light"], body.theme-light, body[data-theme-effective="light"], body[data-theme="light"]:not(.dark-mode)) .activity-card :is(.activity-card__body, .activity-card__meta, small, .muted) {
  color: var(--cdg-a11y-muted) !important;
}

:is(html[data-theme-effective="light"], body.theme-light, body[data-theme-effective="light"], body[data-theme="light"]:not(.dark-mode)) .activity-badge {
  background: #eef4fb !important;
  border-color: #9fb7cf !important;
  color: #273f59 !important;
}

:is(html[data-theme-effective="light"], body.theme-light, body[data-theme-effective="light"], body[data-theme="light"]:not(.dark-mode)) .activity-badge--notif {
  background: #ecfdf5 !important;
  border-color: #059669 !important;
  color: #166534 !important;
}

:is(body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) .ha-hero :is(p, .muted, small) {
  color: #dbeafe !important;
}

:is(body.theme-light.part-body, body[data-theme-effective="light"].part-body, body[data-theme="light"]:not(.dark-mode).part-body) .task-card__title a {
  color: var(--cdg-a11y-primary-strong) !important;
}

/* HelloAsso chart hardening: interactive overlays stay readable in the light theme. */
body.ha-body :is(.ha-chart-tooltip, .ha-floating-tooltip) {
  background: #07111f !important;
  border-color: rgba(203, 213, 225, 0.42) !important;
  color: #f8fafc !important;
  box-shadow: 0 18px 38px rgba(2, 6, 23, 0.48) !important;
}

body.ha-body :is(.ha-chart-tooltip, .ha-floating-tooltip) strong {
  color: #f8fafc !important;
}

body.ha-body :is(.ha-chart-tooltip, .ha-floating-tooltip) span {
  color: #5eead4 !important;
}

body.ha-body :is(.ha-chart-tooltip, .ha-floating-tooltip) small {
  color: #cbd5e1 !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.ha-body :is(.ha-period-tab, .ha-profile-mode),
:is(body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) :is(.ha-period-tab, .ha-profile-mode) {
  background: #ffffff !important;
  border-color: #8eaac8 !important;
  color: #193653 !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.ha-body :is(.ha-period-tab:hover, .ha-period-tab:focus-visible, .ha-profile-mode:hover, .ha-profile-mode:focus-visible),
:is(body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) :is(.ha-period-tab:hover, .ha-period-tab:focus-visible, .ha-profile-mode:hover, .ha-profile-mode:focus-visible) {
  background: #edf8ff !important;
  border-color: #2563eb !important;
  color: #071d33 !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.ha-body :is(.ha-period-tab.is-active, .ha-profile-mode.is-active),
:is(body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) :is(.ha-period-tab.is-active, .ha-profile-mode.is-active) {
  background: #dff7f3 !important;
  border-color: #0f766e !important;
  color: #062033 !important;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.14) !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.ha-body :is(.ha-chart-legend, .ha-chart-scale, .ha-bar-meta),
:is(body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) :is(.ha-chart-legend, .ha-chart-scale, .ha-bar-meta) {
  color: #334d69 !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.ha-body :is(.ha-chart-metrics span, .ha-week-summary span, .ha-week-detail__metrics span),
:is(body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) :is(.ha-chart-metrics span, .ha-week-summary span, .ha-week-detail__metrics span) {
  background: #ffffff !important;
  border-color: #a7bfd6 !important;
  color: #102133 !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.ha-body :is(.ha-chart-metrics small, .ha-week-summary small, .ha-week-detail__metrics small),
:is(body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) :is(.ha-chart-metrics small, .ha-week-summary small, .ha-week-detail__metrics small) {
  color: #2f4c68 !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.ha-body :is(.ha-chart-metrics strong, .ha-week-summary strong, .ha-week-detail__metrics b, .ha-chart-scale strong, .ha-bar-label span),
:is(body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) :is(.ha-chart-metrics strong, .ha-week-summary strong, .ha-week-detail__metrics b, .ha-chart-scale strong, .ha-bar-label span) {
  color: #102133 !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.ha-body .ha-bar-label strong,
:is(body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) .ha-bar-label strong {
  color: #2f4c68 !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.ha-body .ha-bar-track,
:is(body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) .ha-bar-track {
  background: #dbe5ef !important;
  border-color: #8eaac8 !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.ha-body :is(.ha-bar-row:hover, .ha-bar-row:focus-visible, .ha-bar-row.is-active),
:is(body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) :is(.ha-bar-row:hover, .ha-bar-row:focus-visible, .ha-bar-row.is-active) {
  background: rgba(37, 99, 235, 0.1) !important;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.34) !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.ha-body .ha-line-grid,
:is(body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) .ha-line-grid {
  stroke: rgba(74, 101, 130, 0.2) !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.ha-body .ha-line-axis,
:is(body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) .ha-line-axis {
  stroke: rgba(74, 101, 130, 0.38) !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.ha-body .ha-chart-point,
:is(body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) .ha-chart-point {
  fill: #f8fbff !important;
  stroke: #24364b !important;
}

/* HelloAsso forms picker: cards are links, so they need their own light-mode surface. */
:is(html[data-theme="light"], html[data-theme-effective="light"]) body.ha-body .ha-form-picker-card,
:is(body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) .ha-form-picker-card {
  background: #ffffff !important;
  border-color: #9fb7cf !important;
  color: #102133 !important;
  box-shadow: 0 8px 22px rgba(18, 38, 63, 0.08) !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.ha-body :is(.ha-form-picker-card:hover, .ha-form-picker-card:focus-visible),
:is(body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) :is(.ha-form-picker-card:hover, .ha-form-picker-card:focus-visible) {
  background: #eef7ff !important;
  border-color: #2563eb !important;
  color: #071d33 !important;
  box-shadow: 0 14px 30px rgba(18, 38, 63, 0.14) !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.ha-body .ha-form-picker-card strong,
:is(body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) .ha-form-picker-card strong {
  color: #102133 !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.ha-body .ha-form-picker-card > small,
:is(body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) .ha-form-picker-card > small {
  color: #36536f !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.ha-body .ha-form-picker-card .ha-badge,
:is(body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) .ha-form-picker-card .ha-badge {
  background: #eef4fb !important;
  border-color: #9fb7cf !important;
  color: #243b53 !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.ha-body .ha-form-picker-card__metrics,
:is(body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) .ha-form-picker-card__metrics {
  color: #334d69 !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.ha-body .ha-form-picker-card__metrics :is(b, em),
:is(body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) .ha-form-picker-card__metrics :is(b, em) {
  background: #edf4fb !important;
  border: 1px solid #bfd0e3 !important;
  color: #102133 !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.ha-body .ha-form-picker-card__metrics em,
:is(body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) .ha-form-picker-card__metrics em {
  color: #36536f !important;
}

/* HelloAsso full light-mode audit: normalize remaining historical dark widgets. */
:is(html[data-theme="light"], html[data-theme-effective="light"]) body.ha-body :is(
  .ha-space-tab,
  .ha-action-queue-item,
  .ha-activation-card,
  .ha-guided-step,
  .ha-checkout-diagnostic-step,
  .ha-terrain-test-card,
  .ha-form-tab,
  .ha-form-next-actions a,
  .ha-share-presets a,
  .ha-guide-steps a,
  .ha-cashout-status-card,
  .ha-quality-group,
  .ha-tariff-name-card,
  .ha-funnel-step,
  .ha-reconcile-step,
  .ha-compare-note,
  .ha-compare-mini-metrics span,
  .ha-week-row,
  .ha-week-detail,
  .ha-inline-details summary,
  .ha-insights-scope__summary span,
  .ha-insights-filter__toolbar,
  .ha-campaign-choice,
  .ha-followed-form-row__metrics span,
  .ha-zone-row,
  .ha-zone-map,
  .ha-zone-map-stat,
  .ha-zone-map__detail,
  .ha-zone-map__detail-kpis span,
  .ha-terrain-controls,
  .ha-terrain-card,
  .ha-terrain-card__meta span,
  .ha-pagination,
  .ha-page-link,
  .ha-page-gap,
  .ha-table-filters,
  .ha-filter-pill,
  .ha-search-results,
  .ha-search-item,
  .ha-timeline-item,
  .ha-share-fieldset,
  .ha-share-options label,
  .ha-share-edit-card,
  .ha-campaign-fieldset,
  .ha-campaign-flow article,
  .ha-campaign-notes p,
  .ha-check-list p,
  .ha-live-refresh-banner,
  .ha-live-refresh-info,
  .ha-utm-preview,
  .ha-export-card,
  .ha-webhook-diagnostic,
  .ha-quality-workbench
),
:is(body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) :is(
  .ha-space-tab,
  .ha-action-queue-item,
  .ha-activation-card,
  .ha-guided-step,
  .ha-checkout-diagnostic-step,
  .ha-terrain-test-card,
  .ha-form-tab,
  .ha-form-next-actions a,
  .ha-share-presets a,
  .ha-guide-steps a,
  .ha-cashout-status-card,
  .ha-quality-group,
  .ha-tariff-name-card,
  .ha-funnel-step,
  .ha-reconcile-step,
  .ha-compare-note,
  .ha-compare-mini-metrics span,
  .ha-week-row,
  .ha-week-detail,
  .ha-inline-details summary,
  .ha-insights-scope__summary span,
  .ha-insights-filter__toolbar,
  .ha-campaign-choice,
  .ha-followed-form-row__metrics span,
  .ha-zone-row,
  .ha-zone-map,
  .ha-zone-map-stat,
  .ha-zone-map__detail,
  .ha-zone-map__detail-kpis span,
  .ha-terrain-controls,
  .ha-terrain-card,
  .ha-terrain-card__meta span,
  .ha-pagination,
  .ha-page-link,
  .ha-page-gap,
  .ha-table-filters,
  .ha-filter-pill,
  .ha-search-results,
  .ha-search-item,
  .ha-timeline-item,
  .ha-share-fieldset,
  .ha-share-options label,
  .ha-share-edit-card,
  .ha-campaign-fieldset,
  .ha-campaign-flow article,
  .ha-campaign-notes p,
  .ha-check-list p,
  .ha-live-refresh-banner,
  .ha-live-refresh-info,
  .ha-utm-preview,
  .ha-export-card,
  .ha-webhook-diagnostic,
  .ha-quality-workbench
) {
  background: #ffffff !important;
  background-image: none !important;
  border-color: #9fb7cf !important;
  color: #102133 !important;
  box-shadow: 0 8px 22px rgba(18, 38, 63, 0.08) !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.ha-body :is(
  .ha-space-tab,
  .ha-action-queue-item,
  .ha-activation-card,
  .ha-guided-step,
  .ha-checkout-diagnostic-step,
  .ha-terrain-test-card,
  .ha-form-tab,
  .ha-form-next-actions a,
  .ha-share-presets a,
  .ha-guide-steps a,
  .ha-cashout-status-card,
  .ha-quality-group,
  .ha-tariff-name-card,
  .ha-funnel-step,
  .ha-reconcile-step,
  .ha-compare-note,
  .ha-compare-mini-metrics span,
  .ha-week-row,
  .ha-week-detail,
  .ha-inline-details summary,
  .ha-insights-scope__summary span,
  .ha-campaign-choice,
  .ha-followed-form-row__metrics span,
  .ha-zone-row,
  .ha-zone-map,
  .ha-zone-map-stat,
  .ha-zone-map__detail,
  .ha-zone-map__detail-kpis span,
  .ha-terrain-controls,
  .ha-terrain-card,
  .ha-terrain-card__meta span,
  .ha-pagination,
  .ha-page-link,
  .ha-filter-pill,
  .ha-search-item,
  .ha-timeline-item,
  .ha-share-options label,
  .ha-campaign-fieldset,
  .ha-campaign-flow article,
  .ha-check-list p,
  .ha-live-refresh-info
) :is(h1, h2, h3, h4, legend, strong, b, dd),
:is(body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) :is(
  .ha-space-tab,
  .ha-action-queue-item,
  .ha-activation-card,
  .ha-guided-step,
  .ha-checkout-diagnostic-step,
  .ha-terrain-test-card,
  .ha-form-tab,
  .ha-form-next-actions a,
  .ha-share-presets a,
  .ha-guide-steps a,
  .ha-cashout-status-card,
  .ha-quality-group,
  .ha-tariff-name-card,
  .ha-funnel-step,
  .ha-reconcile-step,
  .ha-compare-note,
  .ha-compare-mini-metrics span,
  .ha-week-row,
  .ha-week-detail,
  .ha-inline-details summary,
  .ha-insights-scope__summary span,
  .ha-campaign-choice,
  .ha-followed-form-row__metrics span,
  .ha-zone-row,
  .ha-zone-map,
  .ha-zone-map-stat,
  .ha-zone-map__detail,
  .ha-zone-map__detail-kpis span,
  .ha-terrain-controls,
  .ha-terrain-card,
  .ha-terrain-card__meta span,
  .ha-pagination,
  .ha-page-link,
  .ha-filter-pill,
  .ha-search-item,
  .ha-timeline-item,
  .ha-share-options label,
  .ha-campaign-fieldset,
  .ha-campaign-flow article,
  .ha-check-list p,
  .ha-live-refresh-info
) :is(h1, h2, h3, h4, legend, strong, b, dd) {
  color: #102133 !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.ha-body :is(
  .ha-action-queue-item__status,
  .ha-action-queue-item em,
  .ha-action-queue-item small,
  .ha-activation-card span,
  .ha-activation-card small,
  .ha-activation-card em,
  .ha-guided-step p,
  .ha-checkout-diagnostic-step span,
  .ha-checkout-diagnostic-step small,
  .ha-terrain-test-card p,
  .ha-tariff-name-card small,
  .ha-tariff-name-card span,
  .ha-funnel-step span,
  .ha-funnel-step small,
  .ha-reconcile-step span,
  .ha-reconcile-step small,
  .ha-compare-note p,
  .ha-compare-note small,
  .ha-compare-mini-metrics small,
  .ha-week-row__label small,
  .ha-week-detail p,
  .ha-week-detail__head small,
  .ha-inline-details strong,
  .ha-insights-scope__summary small,
  .ha-insights-filter__toolbar small,
  .ha-insights-filter__search span,
  .ha-campaign-choice__body small,
  .ha-campaign-choice__metrics,
  .ha-followed-form-row__main small,
  .ha-followed-form-row__status small,
  .ha-followed-form-row__metrics small,
  .ha-followed-form-row__metrics em,
  .ha-zone-row__label small,
  .ha-zone-map__toolbar small,
  .ha-zone-map__detail small,
  .ha-zone-map__detail p,
  .ha-zone-map-stat small,
  .ha-zone-map-stat span,
  .ha-zone-map__legend,
  .ha-zone-map__legend-note,
  .ha-terrain-controls__head small,
  .ha-terrain-filter-grid span,
  .ha-terrain-card small,
  .ha-terrain-card__meta span,
  .ha-pagination__meta span,
  .ha-pagination-size span,
  .ha-table-filter-field span,
  .ha-filter-pill span,
  .ha-search-item small,
  .ha-timeline-item small,
  .ha-share-options small,
  .ha-campaign-fieldset label span,
  .ha-field-help,
  .ha-campaign-flow article p,
  .ha-campaign-notes p,
  .ha-check-list span,
  .ha-live-refresh-banner small,
  .ha-live-refresh-extra p,
  .ha-live-refresh-info span,
  .ha-utm-preview,
  .ha-table-legend,
  .ha-dl dt
),
:is(body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) :is(
  .ha-action-queue-item__status,
  .ha-action-queue-item em,
  .ha-action-queue-item small,
  .ha-activation-card span,
  .ha-activation-card small,
  .ha-activation-card em,
  .ha-guided-step p,
  .ha-checkout-diagnostic-step span,
  .ha-checkout-diagnostic-step small,
  .ha-terrain-test-card p,
  .ha-tariff-name-card small,
  .ha-tariff-name-card span,
  .ha-funnel-step span,
  .ha-funnel-step small,
  .ha-reconcile-step span,
  .ha-reconcile-step small,
  .ha-compare-note p,
  .ha-compare-note small,
  .ha-compare-mini-metrics small,
  .ha-week-row__label small,
  .ha-week-detail p,
  .ha-week-detail__head small,
  .ha-inline-details strong,
  .ha-insights-scope__summary small,
  .ha-insights-filter__toolbar small,
  .ha-insights-filter__search span,
  .ha-campaign-choice__body small,
  .ha-campaign-choice__metrics,
  .ha-followed-form-row__main small,
  .ha-followed-form-row__status small,
  .ha-followed-form-row__metrics small,
  .ha-followed-form-row__metrics em,
  .ha-zone-row__label small,
  .ha-zone-map__toolbar small,
  .ha-zone-map__detail small,
  .ha-zone-map__detail p,
  .ha-zone-map-stat small,
  .ha-zone-map-stat span,
  .ha-zone-map__legend,
  .ha-zone-map__legend-note,
  .ha-terrain-controls__head small,
  .ha-terrain-filter-grid span,
  .ha-terrain-card small,
  .ha-terrain-card__meta span,
  .ha-pagination__meta span,
  .ha-pagination-size span,
  .ha-table-filter-field span,
  .ha-filter-pill span,
  .ha-search-item small,
  .ha-timeline-item small,
  .ha-share-options small,
  .ha-campaign-fieldset label span,
  .ha-field-help,
  .ha-campaign-flow article p,
  .ha-campaign-notes p,
  .ha-check-list span,
  .ha-live-refresh-banner small,
  .ha-live-refresh-extra p,
  .ha-live-refresh-info span,
  .ha-utm-preview,
  .ha-table-legend,
  .ha-dl dt
) {
  color: #36536f !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.ha-body :is(
  .ha-action-queue-item b,
  .ha-activation-card b,
  .ha-checkout-diagnostic-step b,
  .ha-compare-note span,
  .ha-followed-form-row__status em,
  .ha-zone-row__link,
  .ha-zone-map__detail-kpis b,
  .ha-terrain-order,
  .ha-campaign-table code
),
:is(body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) :is(
  .ha-action-queue-item b,
  .ha-activation-card b,
  .ha-checkout-diagnostic-step b,
  .ha-compare-note span,
  .ha-followed-form-row__status em,
  .ha-zone-row__link,
  .ha-zone-map__detail-kpis b,
  .ha-terrain-order,
  .ha-campaign-table code
) {
  color: #0f5f56 !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.ha-body :is(.ha-guided-step__index, .ha-guided-step__badge, .ha-person-info-btn),
:is(body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) :is(.ha-guided-step__index, .ha-guided-step__badge, .ha-person-info-btn) {
  background: #eef4fb !important;
  border-color: #9fb7cf !important;
  color: #243b53 !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.ha-body .ha-campaign-flow article span,
:is(body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) .ha-campaign-flow article span {
  background: #dff7f3 !important;
  color: #075e54 !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.ha-body :is(.ha-meter, .ha-zone-track, .ha-bar-track),
:is(body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) :is(.ha-meter, .ha-zone-track, .ha-bar-track) {
  background: #dbe5ef !important;
  border-color: #8eaac8 !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.ha-body .ha-week-bar,
:is(body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) .ha-week-bar {
  color: #061424 !important;
  text-shadow: none !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.ha-body .ha-week-bar--ticket,
:is(body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) .ha-week-bar--ticket {
  background: linear-gradient(90deg, #99f6e4, #2dd4bf) !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.ha-body .ha-week-bar--payment,
:is(body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) .ha-week-bar--payment {
  background: linear-gradient(90deg, #bfdbfe, #60a5fa) !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.ha-body :is(
  .ha-space-tab:hover,
  .ha-space-tab:focus-visible,
  .ha-action-queue-item:hover,
  .ha-action-queue-item:focus-visible,
  .ha-form-tab:hover,
  .ha-form-tab:focus-visible,
  .ha-funnel-step:hover,
  .ha-funnel-step:focus-visible,
  .ha-reconcile-step:focus-within,
  .ha-week-row:hover,
  .ha-week-row:focus-visible,
  .ha-search-item:hover,
  .ha-search-item:focus-visible,
  .ha-timeline-item--link:hover,
  .ha-timeline-item--link:focus-visible,
  .ha-page-link:hover,
  .ha-page-link:focus-visible,
  .ha-filter-pill:hover,
  .ha-filter-pill:focus-visible,
  .ha-live-refresh-info:hover,
  .ha-live-refresh-info:focus-visible
),
:is(body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) :is(
  .ha-space-tab:hover,
  .ha-space-tab:focus-visible,
  .ha-action-queue-item:hover,
  .ha-action-queue-item:focus-visible,
  .ha-form-tab:hover,
  .ha-form-tab:focus-visible,
  .ha-funnel-step:hover,
  .ha-funnel-step:focus-visible,
  .ha-reconcile-step:focus-within,
  .ha-week-row:hover,
  .ha-week-row:focus-visible,
  .ha-search-item:hover,
  .ha-search-item:focus-visible,
  .ha-timeline-item--link:hover,
  .ha-timeline-item--link:focus-visible,
  .ha-page-link:hover,
  .ha-page-link:focus-visible,
  .ha-filter-pill:hover,
  .ha-filter-pill:focus-visible,
  .ha-live-refresh-info:hover,
  .ha-live-refresh-info:focus-visible
) {
  background: #eef7ff !important;
  border-color: #2563eb !important;
  color: #071d33 !important;
  box-shadow: 0 14px 30px rgba(18, 38, 63, 0.14) !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.ha-body :is(
  .ha-space-tab.is-active,
  .ha-form-tab.is-active,
  .ha-filter-pill.is-active,
  .ha-page-link.is-current,
  .ha-week-row.is-active,
  .ha-campaign-choice:has(input:checked),
  .ha-tab-group .tab-link.active,
  .ha-tab-group .tab-link[aria-current="page"]
),
:is(body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) :is(
  .ha-space-tab.is-active,
  .ha-form-tab.is-active,
  .ha-filter-pill.is-active,
  .ha-page-link.is-current,
  .ha-week-row.is-active,
  .ha-campaign-choice:has(input:checked),
  .ha-tab-group .tab-link.active,
  .ha-tab-group .tab-link[aria-current="page"]
) {
  background: #dff7f3 !important;
  border-color: #0f766e !important;
  color: #062033 !important;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.14) !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.ha-body :is(
  .ha-action-queue-item--danger,
  .ha-activation-card--danger,
  .ha-checkout-diagnostic-step--danger,
  .ha-cockpit-card--danger,
  .ha-quality-action--danger,
  .ha-quality-group--critical,
  .ha-webhook-diagnostic--danger,
  .ha-cashout-status-card--ecart
),
:is(body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) :is(
  .ha-action-queue-item--danger,
  .ha-activation-card--danger,
  .ha-checkout-diagnostic-step--danger,
  .ha-cockpit-card--danger,
  .ha-quality-action--danger,
  .ha-quality-group--critical,
  .ha-webhook-diagnostic--danger,
  .ha-cashout-status-card--ecart
) {
  background: #fef2f2 !important;
  border-color: #dc2626 !important;
  color: #7f1d1d !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.ha-body :is(
  .ha-action-queue-item--warn,
  .ha-activation-card--warn,
  .ha-guided-step--warn,
  .ha-checkout-diagnostic-step--warn,
  .ha-cockpit-card--warning,
  .ha-quality-action--warning,
  .ha-quality-group--warning,
  .ha-webhook-diagnostic--warn,
  .ha-cashout-status-card--a-justifier,
  .ha-reconcile-step--warn
),
:is(body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) :is(
  .ha-action-queue-item--warn,
  .ha-activation-card--warn,
  .ha-guided-step--warn,
  .ha-checkout-diagnostic-step--warn,
  .ha-cockpit-card--warning,
  .ha-quality-action--warning,
  .ha-quality-group--warning,
  .ha-webhook-diagnostic--warn,
  .ha-cashout-status-card--a-justifier,
  .ha-reconcile-step--warn
) {
  background: #fff7ed !important;
  border-color: #d97706 !important;
  color: #7c2d12 !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.ha-body :is(
  .ha-action-queue-item--ok,
  .ha-guided-step--done,
  .ha-checkout-diagnostic-step--ok,
  .ha-reconcile-step--ok
),
:is(body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) :is(
  .ha-action-queue-item--ok,
  .ha-guided-step--done,
  .ha-checkout-diagnostic-step--ok,
  .ha-reconcile-step--ok
) {
  background: #ecfdf5 !important;
  border-color: #059669 !important;
  color: #064e3b !important;
}

@media (max-width: 860px) {
  :is(html[data-theme="light"], html[data-theme-effective="light"]) body.ha-body :is(.ha-tabs, .ha-mobile-statusbar, .ha-mobile-quicknav),
  :is(body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) :is(.ha-tabs, .ha-mobile-statusbar, .ha-mobile-quicknav) {
    background: rgba(255, 255, 255, 0.98) !important;
    border-color: #9fb7cf !important;
    color: #102133 !important;
    box-shadow: 0 12px 30px rgba(18, 38, 63, 0.12) !important;
  }

  :is(html[data-theme="light"], html[data-theme-effective="light"]) body.ha-body :is(.ha-mobile-statusbar a, .ha-mobile-quicknav a),
  :is(body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) :is(.ha-mobile-statusbar a, .ha-mobile-quicknav a) {
    background: #eef6fb !important;
    color: #193653 !important;
  }

  :is(html[data-theme="light"], html[data-theme-effective="light"]) body.ha-body :is(.ha-mobile-statusbar span, .ha-mobile-statusbar small, .ha-mobile-quicknav a::before),
  :is(body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) :is(.ha-mobile-statusbar span, .ha-mobile-statusbar small, .ha-mobile-quicknav a::before) {
    color: #36536f !important;
  }

  :is(html[data-theme="light"], html[data-theme-effective="light"]) body.ha-body :is(.ha-mobile-statusbar strong, .ha-mobile-quicknav a[aria-current="page"]),
  :is(body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) :is(.ha-mobile-statusbar strong, .ha-mobile-quicknav a[aria-current="page"]) {
    color: #071d33 !important;
  }

  :is(html[data-theme="light"], html[data-theme-effective="light"]) body.ha-body .ha-mobile-quicknav a[aria-current="page"],
  :is(body.theme-light.ha-body, body[data-theme-effective="light"].ha-body, body[data-theme="light"]:not(.dark-mode).ha-body) .ha-mobile-quicknav a[aria-current="page"] {
    background: #dff7f3 !important;
  }
}

/* Reunions final contrast bridge: the module has historical dark widgets that must follow the active theme. */
:is(html[data-theme="dark"], html[data-theme-effective="dark"]) body.reunions-body,
:is(body.theme-dark.reunions-body, body.dark-mode.reunions-body, body[data-theme-effective="dark"].reunions-body, body.reunions-body[data-theme="dark"]) {
  color-scheme: dark;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.reunions-body,
:is(body.theme-light.reunions-body, body[data-theme-effective="light"].reunions-body, body.reunions-body[data-theme="light"]:not(.dark-mode)) {
  color-scheme: light;
  --text: #102133;
  --text-strong: #061424;
  --muted: #40566f;
  --surface: #ffffff;
  --surface-alt: #edf4fb;
  --border: #9fb7cf;
  --line: #bed0e2;
  --primary: #1267c2;
  --primary-dark: #0d4f9e;
  --chip: #e4eef8;
  --reunions-surface: #ffffff;
  --reunions-surface-strong: #f8fbff;
  --reunions-surface-soft: #edf4fb;
  --reunions-border: #9fb7cf;
  --reunions-border-strong: #2563eb;
  --reunions-warm: #fff7ed;
  --reunions-shadow: 0 12px 28px rgba(18, 38, 63, 0.10);
  --shadow-md: 0 12px 28px rgba(18, 38, 63, 0.10);
  background: linear-gradient(180deg, #edf3fa 0%, #f8fbff 44%, #ffffff 100%) !important;
  color: #102133 !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.reunions-body :is(
  .reunions-workspace-header,
  .card:not(.badge-card),
  .meeting-mobile-rail,
  .notification-panel,
  .notification-item,
  .meeting-row,
  #odjPanel,
  .section-block,
  .agenda-item,
  .agenda-response,
  .agenda-decision,
  .section-files,
  .files li,
  .tasks li,
  .comments-box,
  .comment-row,
  .task-row .comments-pane,
  .task-comment-summary,
  .report-module,
  .report-editor,
  .report-signatures,
  .report-signature-row,
  .report-signatures__form,
  .poll-block,
  .mytasks-group,
  .participants-compact-item,
  .participant-modules label,
  .guest-credentials-notice,
  .meeting-picker__option,
  .task-dialog__meeting,
  .task-dialog__list,
  .task-dialog__option,
  .assignee-picker__panel,
  .assignee-picker__toggle,
  .kanban-column,
  .kanban-card,
  .modal,
  .modal-dialog,
  .file-preview__frame,
  .section-move-option,
  .recurrence-weekdays label
),
:is(body.theme-light.reunions-body, body[data-theme-effective="light"].reunions-body, body.reunions-body[data-theme="light"]:not(.dark-mode)) :is(
  .reunions-workspace-header,
  .card:not(.badge-card),
  .meeting-mobile-rail,
  .notification-panel,
  .notification-item,
  .meeting-row,
  #odjPanel,
  .section-block,
  .agenda-item,
  .agenda-response,
  .agenda-decision,
  .section-files,
  .files li,
  .tasks li,
  .comments-box,
  .comment-row,
  .task-row .comments-pane,
  .task-comment-summary,
  .report-module,
  .report-editor,
  .report-signatures,
  .report-signature-row,
  .report-signatures__form,
  .poll-block,
  .mytasks-group,
  .participants-compact-item,
  .participant-modules label,
  .guest-credentials-notice,
  .meeting-picker__option,
  .task-dialog__meeting,
  .task-dialog__list,
  .task-dialog__option,
  .assignee-picker__panel,
  .assignee-picker__toggle,
  .kanban-column,
  .kanban-card,
  .modal,
  .modal-dialog,
  .file-preview__frame,
  .section-move-option,
  .recurrence-weekdays label
) {
  background: var(--reunions-surface, #ffffff) !important;
  background-image: none !important;
  border-color: var(--reunions-border, #9fb7cf) !important;
  color: #102133 !important;
  box-shadow: 0 10px 24px rgba(18, 38, 63, 0.08) !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.reunions-body :is(.reunions-workspace-header, .meeting-mobile-rail),
:is(body.theme-light.reunions-body, body[data-theme-effective="light"].reunions-body, body.reunions-body[data-theme="light"]:not(.dark-mode)) :is(.reunions-workspace-header, .meeting-mobile-rail) {
  background: linear-gradient(135deg, #ffffff 0%, #edf7ff 100%) !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.reunions-body :is(.meeting-row, .section-block, .agenda-item, .tasks li, .files li, .mytasks-group, .kanban-card, .comment-row),
:is(body.theme-light.reunions-body, body[data-theme-effective="light"].reunions-body, body.reunions-body[data-theme="light"]:not(.dark-mode)) :is(.meeting-row, .section-block, .agenda-item, .tasks li, .files li, .mytasks-group, .kanban-card, .comment-row) {
  background: var(--reunions-surface-soft, #edf4fb) !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.reunions-body :is(
  h1,
  h2,
  h3,
  h4,
  strong,
  b,
  .meeting-title,
  .section-header strong,
  .task-header-row .title,
  .kanban-card-title,
  .file-title,
  .mytasks-header,
  .mytasks-title,
  .notification-item__title,
  .task-comment-summary__title strong
),
:is(body.theme-light.reunions-body, body[data-theme-effective="light"].reunions-body, body.reunions-body[data-theme="light"]:not(.dark-mode)) :is(
  h1,
  h2,
  h3,
  h4,
  strong,
  b,
  .meeting-title,
  .section-header strong,
  .task-header-row .title,
  .kanban-card-title,
  .file-title,
  .mytasks-header,
  .mytasks-title,
  .notification-item__title,
  .task-comment-summary__title strong
) {
  color: #061424 !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.reunions-body :is(
  p,
  li,
  small,
  label,
  .muted,
  .meeting-location,
  .meeting-meta,
  .calendar-create-hint,
  .card-description,
  .notification-item__body,
  .notification-item__meta,
  .task-meta,
  .task-due,
  .mytasks-muted,
  .mytasks-due,
  .task-comment-summary__meta,
  .task-comment-summary__excerpt,
  .agenda-response,
  .agenda-decision,
  .signature-text,
  .task-dialog__hint,
  .meeting-picker__empty
),
:is(body.theme-light.reunions-body, body[data-theme-effective="light"].reunions-body, body.reunions-body[data-theme="light"]:not(.dark-mode)) :is(
  p,
  li,
  small,
  label,
  .muted,
  .meeting-location,
  .meeting-meta,
  .calendar-create-hint,
  .card-description,
  .notification-item__body,
  .notification-item__meta,
  .task-meta,
  .task-due,
  .mytasks-muted,
  .mytasks-due,
  .task-comment-summary__meta,
  .task-comment-summary__excerpt,
  .agenda-response,
  .agenda-decision,
  .signature-text,
  .task-dialog__hint,
  .meeting-picker__empty
) {
  color: #40566f !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.reunions-body :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), textarea, select, .meeting-picker__search, .task-dialog__search),
:is(body.theme-light.reunions-body, body[data-theme-effective="light"].reunions-body, body.reunions-body[data-theme="light"]:not(.dark-mode)) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), textarea, select, .meeting-picker__search, .task-dialog__search) {
  background: #ffffff !important;
  border-color: #8eaac8 !important;
  color: #102133 !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.reunions-body :is(input:focus, textarea:focus, select:focus, .meeting-picker__search:focus, .task-dialog__search:focus),
:is(body.theme-light.reunions-body, body[data-theme-effective="light"].reunions-body, body.reunions-body[data-theme="light"]:not(.dark-mode)) :is(input:focus, textarea:focus, select:focus, .meeting-picker__search:focus, .task-dialog__search:focus) {
  border-color: #1267c2 !important;
  box-shadow: 0 0 0 3px rgba(18, 103, 194, 0.18) !important;
  outline: none !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.reunions-body .btn,
:is(body.theme-light.reunions-body, body[data-theme-effective="light"].reunions-body, body.reunions-body[data-theme="light"]:not(.dark-mode)) .btn {
  --btn-bg: #1267c2;
  --btn-bg-hover: #0d4f9e;
  --btn-border: #0d4f9e;
  --btn-text: #ffffff;
  background: var(--btn-bg) !important;
  border-color: var(--btn-border) !important;
  color: var(--btn-text) !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.reunions-body .btn:hover,
:is(body.theme-light.reunions-body, body[data-theme-effective="light"].reunions-body, body.reunions-body[data-theme="light"]:not(.dark-mode)) .btn:hover {
  background: var(--btn-bg-hover) !important;
  color: var(--btn-text) !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.reunions-body :is(.btn-secondary, .btn-ghost, .card-toggle, .report-toolbar__btn, .tasks-view-toggle .btn, .meeting-row .btn),
:is(body.theme-light.reunions-body, body[data-theme-effective="light"].reunions-body, body.reunions-body[data-theme="light"]:not(.dark-mode)) :is(.btn-secondary, .btn-ghost, .card-toggle, .report-toolbar__btn, .tasks-view-toggle .btn, .meeting-row .btn) {
  --btn-bg: #e8f2fb;
  --btn-bg-hover: #d8e9f8;
  --btn-border: #8eaac8;
  --btn-text: #193653;
  background: #e8f2fb !important;
  border-color: #8eaac8 !important;
  color: #193653 !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.reunions-body :is(.btn-danger, .report-locked-note, .task-blocked),
:is(body.theme-light.reunions-body, body[data-theme-effective="light"].reunions-body, body.reunions-body[data-theme="light"]:not(.dark-mode)) :is(.btn-danger, .report-locked-note, .task-blocked) {
  --btn-bg: #fee2e2;
  --btn-bg-hover: #fecaca;
  --btn-border: #dc2626;
  --btn-text: #991b1b;
  background: #fee2e2 !important;
  border-color: #dc2626 !important;
  color: #991b1b !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.reunions-body :is(.btn-download, .btn-success),
:is(body.theme-light.reunions-body, body[data-theme-effective="light"].reunions-body, body.reunions-body[data-theme="light"]:not(.dark-mode)) :is(.btn-download, .btn-success) {
  --btn-bg: #ecfdf5;
  --btn-bg-hover: #d1fae5;
  --btn-border: #059669;
  --btn-text: #166534;
  background: #ecfdf5 !important;
  border-color: #059669 !important;
  color: #166534 !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.reunions-body :is(.chip, .badge, .task-badge, .task-tag, .odj-num, .kanban-count, .participants-compact-rsvp, .participants-compact-attendance, .task-assignee-chip, .section-file-badge),
:is(body.theme-light.reunions-body, body[data-theme-effective="light"].reunions-body, body.reunions-body[data-theme="light"]:not(.dark-mode)) :is(.chip, .badge, .task-badge, .task-tag, .odj-num, .kanban-count, .participants-compact-rsvp, .participants-compact-attendance, .task-assignee-chip, .section-file-badge) {
  background: #e4eef8 !important;
  border-color: #9fb7cf !important;
  color: #273f59 !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.reunions-body :is(.badge.done, .task-assignee-chip[data-status="done"], .task-assignees--everyone .task-assignee-chip, .participants-compact-rsvp[data-rsvp="yes"], .participants-compact-attendance[data-attendance="present"]),
:is(body.theme-light.reunions-body, body[data-theme-effective="light"].reunions-body, body.reunions-body[data-theme="light"]:not(.dark-mode)) :is(.badge.done, .task-assignee-chip[data-status="done"], .task-assignees--everyone .task-assignee-chip, .participants-compact-rsvp[data-rsvp="yes"], .participants-compact-attendance[data-attendance="present"]) {
  background: #ecfdf5 !important;
  border-color: #059669 !important;
  color: #166534 !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.reunions-body :is(.badge.in_progress, .participants-compact-rsvp[data-rsvp="maybe"], .participants-compact-attendance[data-attendance="excused"], .task-priority--high, .task-assignee-chip[data-status="snoozed"]),
:is(body.theme-light.reunions-body, body[data-theme-effective="light"].reunions-body, body.reunions-body[data-theme="light"]:not(.dark-mode)) :is(.badge.in_progress, .participants-compact-rsvp[data-rsvp="maybe"], .participants-compact-attendance[data-attendance="excused"], .task-priority--high, .task-assignee-chip[data-status="snoozed"]) {
  background: #fff7ed !important;
  border-color: #d97706 !important;
  color: #854d0e !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.reunions-body :is(.badge.cancelled, .participants-compact-rsvp[data-rsvp="no"], .participants-compact-attendance[data-attendance="absent"], .task-priority--urgent),
:is(body.theme-light.reunions-body, body[data-theme-effective="light"].reunions-body, body.reunions-body[data-theme="light"]:not(.dark-mode)) :is(.badge.cancelled, .participants-compact-rsvp[data-rsvp="no"], .participants-compact-attendance[data-attendance="absent"], .task-priority--urgent) {
  background: #fef2f2 !important;
  border-color: #dc2626 !important;
  color: #991b1b !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.reunions-body :is(.badge.todo, .participants-compact-attendance[data-attendance="represented"], .task-priority--normal, .task-deps, .task-files),
:is(body.theme-light.reunions-body, body[data-theme-effective="light"].reunions-body, body.reunions-body[data-theme="light"]:not(.dark-mode)) :is(.badge.todo, .participants-compact-attendance[data-attendance="represented"], .task-priority--normal, .task-deps, .task-files) {
  background: #eff6ff !important;
  border-color: #2563eb !important;
  color: #1d4ed8 !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.reunions-body :is(.task-row[data-status="done"], .agenda-item.is-done, .section-block.is-done),
:is(body.theme-light.reunions-body, body[data-theme-effective="light"].reunions-body, body.reunions-body[data-theme="light"]:not(.dark-mode)) :is(.task-row[data-status="done"], .agenda-item.is-done, .section-block.is-done) {
  background: #ecfdf5 !important;
  border-color: #059669 !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.reunions-body .task-row[data-status="cancelled"],
:is(body.theme-light.reunions-body, body[data-theme-effective="light"].reunions-body, body.reunions-body[data-theme="light"]:not(.dark-mode)) .task-row[data-status="cancelled"] {
  background: #fef2f2 !important;
  border-color: #dc2626 !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.reunions-body :is(.mytasks-status[data-status="done"], .mytasks-status[data-status="in_progress"], .mytasks-status[data-status="todo"], .mytasks-status[data-status="cancelled"]),
:is(body.theme-light.reunions-body, body[data-theme-effective="light"].reunions-body, body.reunions-body[data-theme="light"]:not(.dark-mode)) :is(.mytasks-status[data-status="done"], .mytasks-status[data-status="in_progress"], .mytasks-status[data-status="todo"], .mytasks-status[data-status="cancelled"]) {
  font-weight: 700;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.reunions-body .mytasks-status[data-status="done"],
:is(body.theme-light.reunions-body, body[data-theme-effective="light"].reunions-body, body.reunions-body[data-theme="light"]:not(.dark-mode)) .mytasks-status[data-status="done"] {
  color: #166534 !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.reunions-body .mytasks-status[data-status="in_progress"],
:is(body.theme-light.reunions-body, body[data-theme-effective="light"].reunions-body, body.reunions-body[data-theme="light"]:not(.dark-mode)) .mytasks-status[data-status="in_progress"] {
  color: #854d0e !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.reunions-body .mytasks-status[data-status="todo"],
:is(body.theme-light.reunions-body, body[data-theme-effective="light"].reunions-body, body.reunions-body[data-theme="light"]:not(.dark-mode)) .mytasks-status[data-status="todo"] {
  color: #1d4ed8 !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.reunions-body .mytasks-status[data-status="cancelled"],
:is(body.theme-light.reunions-body, body[data-theme-effective="light"].reunions-body, body.reunions-body[data-theme="light"]:not(.dark-mode)) .mytasks-status[data-status="cancelled"] {
  color: #991b1b !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.reunions-body :is(.fc, .calendar-container .fc),
:is(body.theme-light.reunions-body, body[data-theme-effective="light"].reunions-body, body.reunions-body[data-theme="light"]:not(.dark-mode)) :is(.fc, .calendar-container .fc) {
  background: #ffffff !important;
  border-color: #9fb7cf !important;
  color: #102133 !important;
  box-shadow: 0 10px 24px rgba(18, 38, 63, 0.08) !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.reunions-body .fc :is(.fc-scrollgrid, .fc-scrollgrid td, .fc-scrollgrid th, .fc-day, .fc-daygrid-day, .fc-col-header-cell, .fc-list, .fc-list-day, .fc-list-event td),
:is(body.theme-light.reunions-body, body[data-theme-effective="light"].reunions-body, body.reunions-body[data-theme="light"]:not(.dark-mode)) .fc :is(.fc-scrollgrid, .fc-scrollgrid td, .fc-scrollgrid th, .fc-day, .fc-daygrid-day, .fc-col-header-cell, .fc-list, .fc-list-day, .fc-list-event td) {
  background: #ffffff !important;
  border-color: #bed0e2 !important;
  color: #102133 !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.reunions-body .fc :is(.fc-weekday, .fc-col-header-cell, .fc-list-day, .fc-daygrid-day-number),
:is(body.theme-light.reunions-body, body[data-theme-effective="light"].reunions-body, body.reunions-body[data-theme="light"]:not(.dark-mode)) .fc :is(.fc-weekday, .fc-col-header-cell, .fc-list-day, .fc-daygrid-day-number) {
  color: #334a62 !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.reunions-body .fc :is(.fc-day--outside, .fc-day-other),
:is(body.theme-light.reunions-body, body[data-theme-effective="light"].reunions-body, body.reunions-body[data-theme="light"]:not(.dark-mode)) .fc :is(.fc-day--outside, .fc-day-other) {
  background: #edf4fb !important;
  opacity: 1 !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.reunions-body .fc :is(.fc-day--today, .fc-day-today),
:is(body.theme-light.reunions-body, body[data-theme-effective="light"].reunions-body, body.reunions-body[data-theme="light"]:not(.dark-mode)) .fc :is(.fc-day--today, .fc-day-today) {
  background: #dff7f3 !important;
  border-color: #0f766e !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.reunions-body .fc :is(.fc-button, .fc-button-primary),
:is(body.theme-light.reunions-body, body[data-theme-effective="light"].reunions-body, body.reunions-body[data-theme="light"]:not(.dark-mode)) .fc :is(.fc-button, .fc-button-primary) {
  background: #e8f2fb !important;
  border-color: #8eaac8 !important;
  color: #193653 !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.reunions-body .fc :is(.fc-button:hover, .fc-button:focus-visible, .fc-button-primary:hover, .fc-button-primary:focus-visible),
:is(body.theme-light.reunions-body, body[data-theme-effective="light"].reunions-body, body.reunions-body[data-theme="light"]:not(.dark-mode)) .fc :is(.fc-button:hover, .fc-button:focus-visible, .fc-button-primary:hover, .fc-button-primary:focus-visible) {
  background: #d8e9f8 !important;
  border-color: #1267c2 !important;
  color: #071d33 !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.reunions-body .fc :is(.fc-button-active, .fc-button-primary:not(:disabled).fc-button-active),
:is(body.theme-light.reunions-body, body[data-theme-effective="light"].reunions-body, body.reunions-body[data-theme="light"]:not(.dark-mode)) .fc :is(.fc-button-active, .fc-button-primary:not(:disabled).fc-button-active) {
  background: #1267c2 !important;
  border-color: #0d4f9e !important;
  color: #ffffff !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.reunions-body .fc :is(.fc-event, .fc-daygrid-event, .fc-list-event-dot),
:is(body.theme-light.reunions-body, body[data-theme-effective="light"].reunions-body, body.reunions-body[data-theme="light"]:not(.dark-mode)) .fc :is(.fc-event, .fc-daygrid-event, .fc-list-event-dot) {
  background: #1267c2 !important;
  border-color: #0d4f9e !important;
  color: #ffffff !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body.reunions-body .fc :is(.fc-event-main, .fc-event-title, .fc-event-time),
:is(body.theme-light.reunions-body, body[data-theme-effective="light"].reunions-body, body.reunions-body[data-theme="light"]:not(.dark-mode)) .fc :is(.fc-event-main, .fc-event-title, .fc-event-time) {
  color: #ffffff !important;
}

/* Cross-app light-mode parity: portal and business apps must keep the same readable surface model as HelloAsso. */
:is(html[data-theme="light"], html[data-theme-effective="light"]) body,
:is(body.theme-light, body[data-theme-effective="light"], body[data-theme="light"]:not(.dark-mode)) {
  --cdg-a11y-text: #102133;
  --cdg-a11y-strong: #061424;
  --cdg-a11y-muted: #40566f;
  --cdg-a11y-surface: #ffffff;
  --cdg-a11y-surface-soft: #edf4fb;
  --cdg-a11y-control: #e4eef8;
  --cdg-a11y-control-hover: #d7e7f5;
  --cdg-a11y-border: #9fb7cf;
  color: var(--cdg-a11y-text) !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) :is(
  body.portal-home,
  body.app-layout,
  body.part-body,
  body.reunions-body,
  body.ged-page,
  body.subv-body,
  body.accred-body,
  body.webmail-body,
  body.facture-body,
  body.cerfa-body
) :is(
  .card:not(.badge-card),
  .portal-card,
  .portal-row,
  .portal-alink,
  .portal-kpi,
  .portal-action-tile,
  .portal-field-action,
  .portal-tabs--page,
  .section-nav,
  .empty-state,
  .activity-card,
  .dashboard-kpi-card,
  .app-panel,
  .cdg-card,
  .cdg-shell-card,
  .part-page-meta__item,
  .part-filter-pill,
  .part-quick-actions a,
  .task-card,
  .cerfa-summary__item,
  .cerfa-summary__panel,
  .cerfa-summary__chip,
  .ged-summary-item,
  .ged-detail-block,
  .ged-document-hero,
  .ged-detail-card,
  .preview-frame,
  .ged-tag-box,
  .ged-tag-pill,
  .subv-kpi-card,
  .subv-kanban__column,
  .subv-kanban__card,
  .subv-filter-card,
  .subv-table-card,
  .subv-input-with-action,
  .subv-autocomplete,
  .webmail-panel,
  .webmail-header,
  .webmail-toolbar,
  .webmail-toolbar-advanced,
  .wm-thread,
  .wm-ged-item,
  .webmail-preview,
  .wrap--accred .accred-kpi-card,
  .wrap--accred .accred-bars__row,
  .wrap--accred .stack-list__item,
  .wrap--accred .trombi-card,
  .wrap--accred .accred-page-head,
  .wrap--accred .accred-create-progress__item,
  .wrap--accred .accred-source-tab,
  .wrap--accred .accred-source-panel,
  .wrap--accred .accred-search-result,
  .wrap--accred .accred-choice-card,
  .wrap--accred .accred-photo-dropzone,
  .wrap--accred .accred-validation-box,
  .wrap--accred .accred-mini-badge,
  .wrap--accred .accred-create-summary,
  .wrap--accred .accred-quick-stat,
  .wrap--accred .accred-filter-chip,
  .wrap--accred .accred-control-pill,
  .reunions-body .card,
  .reunions-body .task-row,
  .reunions-body .agenda-item,
  .reunions-body .section-block,
  .reunions-body .meeting-card,
  .reunions-body .odj-card,
  .reunions-body .notification-panel
) {
  background-color: var(--cdg-a11y-surface) !important;
  background-image: none !important;
  border-color: var(--cdg-a11y-border) !important;
  color: var(--cdg-a11y-text) !important;
  box-shadow: 0 8px 22px rgba(18, 38, 63, 0.08) !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) :is(
  body.portal-home,
  body.app-layout,
  body.part-body,
  body.reunions-body,
  body.ged-page,
  body.subv-body,
  body.accred-body,
  body.webmail-body,
  body.facture-body,
  body.cerfa-body
) :is(
  h1,
  h2,
  h3,
  h4,
  .page-title,
  .card-title,
  .portal-card__title,
  .portal-row strong,
  .portal-kpi strong,
  .activity-card__title,
  .task-card__title,
  .cerfa-summary__value,
  .ged-document-title,
  .ged-summary-item strong,
  .ged-detail-grid dd,
  .subv-kpi-value,
  .subv-kanban__title,
  .subv-kanban__card strong,
  .webmail-header h1,
  .webmail-panel h2,
  .wm-thread strong,
  .wrap--accred .accred-kpi-card__value,
  .wrap--accred .accred-kpi-card__label,
  .wrap--accred .trombi-card__name,
  .wrap--accred .accred-mini-badge__name,
  .reunions-body .card h2,
  .reunions-body .card h3,
  .reunions-body .task-row strong,
  .reunions-body .agenda-item strong,
  .reunions-body .section-block strong
) {
  color: var(--cdg-a11y-strong) !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) :is(
  body.portal-home,
  body.app-layout,
  body.part-body,
  body.reunions-body,
  body.ged-page,
  body.subv-body,
  body.accred-body,
  body.webmail-body,
  body.facture-body,
  body.cerfa-body
) :is(
  .muted,
  small,
  .portal-card__meta,
  .portal-row small,
  .portal-kpi span,
  .activity-card__body,
  .activity-card__meta,
  .task-card__meta,
  .cerfa-summary__label,
  .ged-document-subline,
  .ged-summary-item span,
  .ged-detail-grid dt,
  .preview-meta,
  .subv-kpi-label,
  .subv-kanban__meta,
  .webmail-panel small,
  .wm-thread small,
  .wrap--accred .accred-kpi-card__eyebrow,
  .wrap--accred .accred-kpi-card__caption,
  .wrap--accred .accred-kpi-card__hint,
  .wrap--accred .trombi-card__meta,
  .wrap--accred .accred-photo-dropzone__hint,
  .wrap--accred .accred-mini-badge__meta,
  .reunions-body .muted,
  .reunions-body .card-description,
  .reunions-body form label span,
  .reunions-body .task-row small,
  .reunions-body .agenda-item small,
  .reunions-body .section-block small
) {
  color: var(--cdg-a11y-muted) !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) :is(
  body.portal-home,
  body.app-layout,
  body.part-body,
  body.reunions-body,
  body.ged-page,
  body.subv-body,
  body.accred-body,
  body.webmail-body,
  body.facture-body,
  body.cerfa-body
) :is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  textarea,
  select,
  .search-input,
  .form-control,
  .form-select
) {
  background: #ffffff !important;
  border-color: var(--input-border, #9dafc1) !important;
  color: var(--cdg-a11y-text) !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) :is(
  body.portal-home,
  body.app-layout,
  body.part-body,
  body.reunions-body,
  body.ged-page,
  body.subv-body,
  body.accred-body,
  body.webmail-body,
  body.facture-body,
  body.cerfa-body
) :is(
  .badge,
  .chip,
  .pill,
  .status-badge,
  .badge-status,
  .subv-pill,
  .subv-status,
  .accred-flag,
  .accred-control-pill,
  .accred-filter-chip,
  .accred-quick-stat,
  .ged-tag-pill,
  .task-badge,
  .task-tag,
  .participants-compact-rsvp,
  .participants-compact-attendance
) {
  background: #eef4fb !important;
  border-color: #9fb7cf !important;
  color: #273f59 !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body :is(.webmail-wrap, .facture-wrap, .cerfa-container, .wrap--md) :is(
  .card:not(.badge-card),
  .webmail-panel,
  .webmail-header,
  .webmail-toolbar,
  .webmail-toolbar-advanced,
  .wm-thread,
  .wm-ged-item,
  .webmail-preview,
  .facture-queue-card,
  .facture-queue-panel,
  .facture-history-header,
  .facture-actions,
  .cerfa-assistant,
  .cerfa-preview,
  .cerfa-preflight,
  .mail-recipient-hint
) {
  background-color: var(--cdg-a11y-surface) !important;
  background-image: none !important;
  border-color: var(--cdg-a11y-border) !important;
  color: var(--cdg-a11y-text) !important;
  box-shadow: 0 8px 22px rgba(18, 38, 63, 0.08) !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body :is(.webmail-wrap, .facture-wrap, .cerfa-container, .wrap--md) :is(
  h1,
  h2,
  h3,
  h4,
  strong,
  b,
  .facture-queue-summary__heading,
  .cerfa-summary__value
) {
  color: var(--cdg-a11y-strong) !important;
}

:is(html[data-theme="light"], html[data-theme-effective="light"]) body :is(.webmail-wrap, .facture-wrap, .cerfa-container, .wrap--md) :is(
  .muted,
  small,
  .facture-queue-summary__state,
  .cerfa-summary__label,
  .mail-recipient-hint
) {
  color: var(--cdg-a11y-muted) !important;
}
