/* ESUN Suite appearance. The slide canvas, document paper and signature PDF keep
   their authored colors; these rules affect the surrounding application UI. */
html[data-esd-theme="light"] {
  --esun-ui-bg: #f2f6fc;
  --esun-ui-panel: #fff;
  --esun-ui-raised: #f7faff;
  --esun-ui-ink: #172544;
  --esun-ui-muted: #52637d;
  --esun-ui-line: #cbd7e8;
  --esun-ui-link: #174494;
  --esun-ui-focus: #174494;
  --esun-ui-soft: #e8f0ff;
  --esun-ui-soft-ink: #174494;
  --esun-ui-success: #135c3a;
  --esun-ui-danger: #a1283b;
}
html[data-esd-theme="dark"] {
  --esun-ui-bg: #0d1729;
  --esun-ui-panel: #17253b;
  --esun-ui-raised: #21334e;
  --esun-ui-ink: #f1f6ff;
  --esun-ui-muted: #bfcee3;
  --esun-ui-line: #4b6281;
  --esun-ui-link: #b4d3ff;
  --esun-ui-focus: #ffcf62;
  --esun-ui-soft: #263e61;
  --esun-ui-soft-ink: #c0dcff;
  --esun-ui-success: #9ae6bd;
  --esun-ui-danger: #ffb4c1;
}

/* The theme choice stays available in the profile card on desktop and mobile. */
.esd-start-profile-menu .esd-theme-chooser {
  display: grid;
  gap: 8px;
  padding: 12px 8px 13px;
  border-top: 1px solid rgba(170, 199, 240, .25);
  color: #e8f1ff;
  font: 700 11px/1.4 Sora, sans-serif;
}
.esd-theme-chooser > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.esd-theme-chooser button {
  min-height: 36px;
  border: 1px solid rgba(174, 205, 248, .35);
  border-radius: 8px;
  background: rgba(137, 180, 244, .12);
  color: #f1f6ff;
  padding: 6px 4px;
  font: 650 10px/1.2 Sora, sans-serif;
  cursor: pointer;
}
.esd-theme-chooser button[aria-pressed="true"] { border-color: #ffd16a; background: #ffd16a; color: #12294c; }
.esd-theme-chooser button:disabled { opacity: .7; cursor: wait; }
.esd-theme-chooser [role="status"]:empty { display: none; }
.esd-theme-chooser [role="status"] { color: #d9eaff; font-size: 10px; }
/* Restore readable labels where the legacy desktop used 6–9px text. */
.esd-start-menu .esd-start-app small,
.esd-start-menu .esd-start-category p,
.esd-start-menu .esd-start-user small,
.esd-start-menu .esd-start-profile-menu :is(header small, button small) { font-size: 11px; line-height: 1.35; }
.esd-start-menu .esd-start-category strong,
.esd-start-menu .esd-start-app strong { font-size: 12px; line-height: 1.25; }
.esd-start-menu .esd-start-section > header :is(button, label, select) { font-size: 11px !important; }
.esd-account :is(.esd-account-fields label, .esd-account-card > header p, .esd-account-hint, .esd-account-fold > summary .esd-fold-subtitle) { font-size: 12px; }
.esd-account .esd-account-fields :is(input, select) { font-size: 13px; }
.esd-reports :is(.esd-reports-field, .esd-reports-bar-caption, .esd-reports-kpi small, .esd-reports-list-rows small) { font-size: 11px; }

/* Light desktop: the shell shares the same bright palette as its windows. */
html[data-esd-theme="light"] body.esd-os-shell:not(.has-custom-wallpaper) {
  background: radial-gradient(circle at 84% 0, #d9e8ff, transparent 40%), linear-gradient(150deg, #e9f1fc, #f7faff);
  color: var(--esun-ui-ink);
}
html[data-esd-theme="light"] body.esd-os-shell:not(.has-custom-wallpaper)::before,
html[data-esd-theme="light"] body.esd-os-shell:not(.has-custom-wallpaper)::after { display: none; }
html[data-esd-theme="light"] body.esd-os-shell:not(.has-custom-wallpaper) .esd-portal-app { background: transparent; }
html[data-esd-theme="light"] body.esd-os-shell:not(.has-custom-wallpaper) .esd-desktop-icons strong { color: #10243f; text-shadow: 0 1px 2px #fff; }
html[data-esd-theme="light"] body.esd-os-shell.has-custom-wallpaper .esd-desktop-icons strong { box-sizing: border-box; border-radius: 6px; background: rgba(8, 24, 48, .86); padding: 2px 4px; color: #fff; text-shadow: none; }
html[data-esd-theme="light"] body.esd-os-shell :is(.esd-suite-dock, .esd-desktop-clock-widget) {
  border-color: #aec6e6;
  background: rgba(248, 251, 255, .94);
  color: #152846;
  box-shadow: 0 14px 35px #17345b33;
}
html[data-esd-theme="light"] body.esd-os-shell .esd-desktop-clock-widget :is(span, small) { color: #425773; }
html[data-esd-theme="light"] body.esd-os-shell .esd-suite-dock :is(.esd-dock-launcher, button) { color: #142c50; }
html[data-esd-theme="light"] body.esd-os-shell .esd-suite-dock .esd-dock-launcher > .esd-apps-grid { color: #142c50; }
html[data-esd-theme="light"] body.esd-os-shell .esd-suite-dock .esd-apps-grid i { background: #24466e; }
html[data-esd-theme="light"] body.esd-os-shell .esd-suite-dock > button.is-running::after { background: #245194; }
html[data-esd-theme="light"] body.esd-os-shell .esd-suite-dock .esd-dock-separator { background: #a9bfdc; }
html[data-esd-theme="light"] body.esd-os-shell .esd-global-launcher.esd-start-menu,
html[data-esd-theme="light"] body.esd-os-shell .esd-start-menu .esd-start-profile-menu {
  border-color: #aac1df;
  background: linear-gradient(155deg, rgba(255,255,255,.98), rgba(231,241,254,.98));
  color: #142949;
  box-shadow: 0 24px 70px #10234744;
}
html[data-esd-theme="light"] .esd-start-menu :is(.esd-start-section h2, .esd-start-user strong, .esd-start-profile-menu header strong) { color: #142949; }
html[data-esd-theme="light"] .esd-start-menu :is(.esd-start-category p, .esd-start-app small, .esd-start-user small, .esd-start-profile-menu header small, .esd-start-profile-menu > footer) { color: #405877; }
html[data-esd-theme="light"] .esd-start-menu :is(.esd-start-app, .esd-start-category, .esd-start-search) { border-color: #bbcee7; background: #f7faff; color: #142949; }
html[data-esd-theme="light"] .esd-start-menu .esd-start-search input { color: #142949 !important; }
html[data-esd-theme="light"] .esd-start-menu .esd-start-search input::placeholder { color: #536985; }
html[data-esd-theme="light"] .esd-start-menu .esd-start-search svg { stroke: #174494; }
html[data-esd-theme="light"] .esd-start-menu .esd-start-search kbd { border-color: #b3c7e2; background: #e7f0fc; color: #314b70; }
html[data-esd-theme="light"] .esd-start-menu :is(.esd-start-app strong, .esd-start-category strong, .esd-start-section > header > button, .esd-start-section > header label) { color: #142949; }
html[data-esd-theme="light"] .esd-start-menu .esd-start-section > header select { color: #142949 !important; }
html[data-esd-theme="light"] .esd-start-menu .esd-start-section > header select option { background: #fff; color: #142949; }
html[data-esd-theme="light"] .esd-start-menu .esd-start-section + section,
html[data-esd-theme="light"] .esd-start-menu :is(.esd-start-footer, .esd-start-profile-menu > header, .esd-start-profile-menu > footer) { border-color: #bfcee0; }
html[data-esd-theme="light"] .esd-start-menu .esd-start-footer { background: #e7f0fc; }
html[data-esd-theme="light"] .esd-start-menu .esd-start-actions { border-color: #b3c7e2; }
html[data-esd-theme="light"] .esd-start-menu .esd-start-actions > :is(a,button) { color: #183a70 !important; }
html[data-esd-theme="light"] .esd-start-menu .esd-start-actions > :is(a,button):is(:hover,:focus-visible) { background: #cfdef3; }
html[data-esd-theme="light"] .esd-start-menu :is(.esd-start-app,.esd-start-category):is(:hover,:focus-within) { border-color: #7394c4; background: #e5effd; color: #142949; }
html[data-esd-theme="light"] .esd-start-menu .esd-start-app em { background: #dbe7fa; color: #194489; }
html[data-esd-theme="light"] .esd-start-menu .esd-start-empty { color: #405877; }
html[data-esd-theme="light"] .esd-start-menu .esd-start-category-open { border: 1px solid #a9bedb; background: #e5effd; color: #194489; }
html[data-esd-theme="light"] .esd-start-menu :is(.esd-start-category-apps > button,.esd-start-category-app-wrap > button[data-esd-open-app]) { background: #e6effb; }
html[data-esd-theme="light"] .esd-start-menu .esd-start-pin-toggle { border-color: #9bb4d7; background: #e5effd; color: #194489; }
html[data-esd-theme="light"] .esd-start-menu .esd-start-profile-menu :is(button, a) { color: #173250 !important; }
html[data-esd-theme="light"] .esd-start-menu .esd-start-profile-menu button small { color: #526988; }
html[data-esd-theme="light"] .esd-start-menu .esd-start-profile-menu > :is(button,a):is(:hover,:focus-visible) { background: #dceafa; }
html[data-esd-theme="light"] .esd-start-menu .esd-start-profile-menu > :is(button,a) > span:first-child { background: #dceafa; color: #174494; }
html[data-esd-theme="light"] .esd-start-menu .esd-start-profile-menu > footer strong { color: #79500d; }
html[data-esd-theme="light"] .esd-start-menu .esd-theme-chooser { border-color: #bfcee0; color: #1a3458; }
html[data-esd-theme="light"] .esd-start-menu .esd-theme-chooser button { border-color: #afc3df; background: #f4f8ff; color: #18345a; }
html[data-esd-theme="light"] .esd-start-menu .esd-theme-chooser button[aria-pressed="true"] { border-color: #19458f; background: #19458f; color: white !important; }
html[data-esd-theme="light"] .esd-start-menu .esd-theme-chooser [role="status"] { color: #315077; }
html[data-esd-theme="light"] .esd-os-window-titlebar { border-color: #c7d5e6; background: #e9f1fb; color: #152a4a; }
html[data-esd-theme="light"] .esd-os-window-titlebar :is(strong, small, button) { color: #183250; }
html[data-esd-theme="light"] .esd-os-window:not(.is-focused) .esd-os-window-titlebar { border-color: #c7d5e6; background: #e4ebf5; }
html[data-esd-theme] .esd-os-window:not(.is-focused) .esd-os-window-controls button { filter:none;opacity:1; }
html[data-esd-theme] .esd-os-window-controls .is-close { background:#b32d3b!important; }
html[data-esd-theme] .esd-os-window-controls .is-minimize { background:#f5c75e!important; }
html[data-esd-theme] .esd-os-window-controls .is-maximize { background:#55c88a!important; }
html[data-esd-theme] .esd-os-window-controls .is-close::after { color:#fff; }
html[data-esd-theme] .esd-os-window-controls :is(.is-minimize,.is-maximize)::after { color:#173250; }
html[data-esd-theme] .esd-os-window-controls .is-close:is(:hover,:focus-visible) { background:#91202d!important; }
html[data-esd-theme] .esd-os-window-controls .is-minimize:is(:hover,:focus-visible) { background:#e5ac33!important; }
html[data-esd-theme] .esd-os-window-controls .is-maximize:is(:hover,:focus-visible) { background:#36b372!important; }
html[data-esd-theme] .esd-os-window-titlebar :is(.esd-os-window-tools,.esd-os-window-controls) button:focus-visible { outline:2px solid var(--esun-ui-focus);outline-offset:2px; }
html[data-esd-theme="light"] .esd-os-window-tools button:is(:hover,:focus-visible) { background: #ccddf3; color: #102c59; }
html[data-esd-theme="light"] .esd-os-window-tools .is-fullscreen-toggle.is-active { background: #d4e4f9; color: #173a70; }
html[data-esd-theme="light"] .esd-os-window-tools [data-esd-window-home]:is(:hover,:focus-visible) { background: #fff1cb; color: #694b06; }
html[data-esd-theme="light"] .esd-suite-dock > button:is(:hover,:focus-visible) { background: #dceafa; }
html[data-esd-theme="light"] .esd-system-fullscreen-button { border-color: #a6bbd9; background: #f3f8ff; color: #173a70; opacity: .85; }
html[data-esd-theme="light"] .esd-system-fullscreen-button:is(:hover,:focus-visible) { background: #dceafa; color: #173a70; }
html[data-esd-theme="light"] .esd-mobile-home-button { border-color: #9eb5d5; background: #f3f8ff; color: #173a70; }

/* Dark application surfaces. Scoped to authenticated Suite modules. */
/* The desktop itself must stay transparent so its wallpaper can show through.
   Fullscreen paints its own background (including a custom wallpaper). */
html[data-esd-theme="dark"] :is(body.esd-chromeless, body.esd-desktop-embed, .esd-portal-shell, .esd-studio, .esd-reports, .esd-crm-hub, .esd-kits-app) {
  background: var(--esun-ui-bg) !important;
  color: var(--esun-ui-ink);
}
html[data-esd-theme="dark"] body.esd-desktop-embed { color-scheme: dark; }
html[data-esd-theme="dark"] .esd-studio { --es-ink: var(--esun-ui-ink); --es-muted: var(--esun-ui-muted); --es-line: var(--esun-ui-line); --es-blue: #b4d3ff; }
html[data-esd-theme="dark"] .esd-kits-app { --kit-ink: var(--esun-ui-ink); --kit-muted: var(--esun-ui-muted); --kit-line: var(--esun-ui-line); --kit-blue: #b4d3ff; }
html[data-esd-theme="dark"] :is(.esd-portal-shell .esd-card, .esd-metrics article, .esd-account-card, .esd-account-crop > section, .esd-reports-card, .esd-reports-kpi, .esd-reports-dialog-panel, .esd-crm-hub-sidebar, .esd-studio-search, .esd-studio-panel, .esd-studio-list, .esd-studio-empty, .esd-studio-table-wrap, .esd-slides-rail, .esd-slides-main, .esd-drive-sidebar, .esd-mail-card, .esd-sign-card, .esd-sign-person-dialog, .esd-kits-card) {
  border-color: var(--esun-ui-line) !important;
  background: var(--esun-ui-panel) !important;
  color: var(--esun-ui-ink) !important;
}
html[data-esd-theme="dark"] :is(.esd-account, .esd-reports, .esd-crm-hub, .esd-studio, .esd-mail-app, .esd-sign-app, .esd-kits-app) :is(h1,h2,h3,h4,h5,legend,label,summary,strong,th,td,p,small):not(.esd-slide-canvas *) { color: var(--esun-ui-ink); }
html[data-esd-theme="dark"] :is(.esd-account, .esd-reports, .esd-crm-hub, .esd-studio, .esd-mail-app, .esd-sign-app, .esd-kits-app) :is(a:not(.esd-studio-primary), .button-link) { color: var(--esun-ui-link); }
html[data-esd-theme="dark"] :is(.esd-account, .esd-reports, .esd-crm-hub, .esd-studio, .esd-mail-app, .esd-sign-app, .esd-kits-app) :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea, .esd-slides-token-editor) {
  border-color: var(--esun-ui-line) !important;
  background: var(--esun-ui-raised) !important;
  color: var(--esun-ui-ink) !important;
}
html[data-esd-theme="dark"] :is(.esd-account, .esd-reports, .esd-crm-hub, .esd-studio, .esd-mail-app, .esd-sign-app, .esd-kits-app) :is(input,textarea)::placeholder { color: var(--esun-ui-muted); opacity: 1; }
html[data-esd-theme="dark"] :is(.esd-portal-shell, .esd-account, .esd-reports, .esd-crm-hub, .esd-studio, .esd-mail-app, .esd-sign-app, .esd-kits-app, .esun-propostas-hub, .esun-proposta-modal, .esun-edit-modal, .esun-proposta-wrap) select { color-scheme: dark; }
html[data-esd-theme="dark"] :is(.esd-portal-shell, .esd-account, .esd-reports, .esd-crm-hub, .esd-studio, .esd-mail-app, .esd-sign-app, .esd-kits-app, .esun-propostas-hub, .esun-proposta-modal, .esun-edit-modal, .esun-proposta-wrap) select option { background: var(--esun-ui-panel); color: var(--esun-ui-ink); }
html[data-esd-theme="dark"] :is(.esd-account, .esd-reports, .esd-crm-hub, .esd-studio, .esd-mail-app, .esd-sign-app, .esd-kits-app) :is(button:where(:not(.esd-studio-primary):not(.esd-mail-primary):not(.esd-sign-button)), .esd-account-button:where(:not(.is-primary))) {
  border-color: var(--esun-ui-line);
  background-color: var(--esun-ui-raised);
  color: var(--esun-ui-ink);
}
html[data-esd-theme="dark"] :is(.esd-account-stats > div, .esd-studio-question, .esd-studio-share, .esd-studio-row:hover, .esd-studio-table-wrap th, .esd-slides-item, .esd-slides-composer, .esd-slides-selected, .esd-slides-token-guide, .esd-slides-story-copy, .esd-slides-data-source, .esd-slides-kicker-edit, .esd-slides-preview-picker, .esd-slides-ribbon, .esd-slides-stage, .esd-slides-controls, .esd-slides-inspector-section, .esd-drive-upload, .esd-mail-toggle, .esd-sign-row, .esd-sign-person, .esd-sign-recipients li, .esd-sign-review, .esd-sign-placement-side, .esd-sign-people, .esd-sign-empty) {
  border-color: var(--esun-ui-line) !important;
  background: var(--esun-ui-raised) !important;
  color: var(--esun-ui-ink);
}
html[data-esd-theme="dark"] :is(.esd-studio-hero, .esd-studio-heading, .esd-mail-heading, .esd-sign-heading, .esd-account-hero, .esd-crm-hub-heading) :is(h1,p,span) { color: #f1f6ff; }
html[data-esd-theme="dark"] .esd-account-fold[open] > summary,
html[data-esd-theme="dark"] .esd-account-fold > summary:hover { background: var(--esun-ui-raised); }
html[data-esd-theme="dark"] .esd-account-fold > summary :is(.esd-fold-title, .esd-fold-subtitle) { color: var(--esun-ui-ink); }
html[data-esd-theme="dark"] :is(.esd-reports-sidebar, .esd-crm-hub-sidebar) { border-color: var(--esun-ui-line); background: var(--esun-ui-panel); }
html[data-esd-theme="dark"] :is(.esd-reports-sidebar, .esd-crm-hub-sidebar) :is(a, strong, small, span) { color: var(--esun-ui-ink); }
html[data-esd-theme="dark"] :is(.esd-reports-sidebar nav a.is-active, .esd-crm-hub-sidebar nav a.is-active) { background: var(--esun-ui-raised); color: var(--esun-ui-link); }
html[data-esd-theme="dark"] :is(.esd-reports-card h2, .esd-reports-heading h1, .esd-crm-hub-heading h1, .esd-reports-kpi strong, .esd-reports-list-rows strong) { color: var(--esun-ui-ink); }
html[data-esd-theme="dark"] :is(.esd-reports, .esd-crm-hub) :is(p, small, label, th, td) { color: var(--esun-ui-muted); }
html[data-esd-theme="dark"] :is(.esd-reports-filterbar, .esd-reports-dialog-panel) :is(select, input, button) { background: var(--esun-ui-raised); border-color: var(--esun-ui-line); color: var(--esun-ui-ink); }
html[data-esd-theme="dark"] .esd-reports-bar-track { background: var(--esun-ui-line); }
html[data-esd-theme="dark"] :is(.esd-kits-global, .esd-kits-index, .esd-kits-editor, .esd-kits-row, .esd-kits-search-wrap, .esd-kits-input, .esd-kits-metrics > div, .esd-kits-info) { border-color: var(--esun-ui-line); background: var(--esun-ui-panel); color: var(--esun-ui-ink); }
html[data-esd-theme="dark"] .esd-kits-app .esd-kits-row.is-selected { background: var(--esun-ui-raised); }
html[data-esd-theme="dark"] .esd-kits-app .esd-kits-button-primary { background: #ffcb4e; border-color: #ffcb4e; color: #122644; }
html[data-esd-theme="dark"] .esd-kits-filters button[aria-pressed="true"] { background: #b4d3ff; color: #102440; }
html[data-esd-theme="dark"] .esd-kits-filters { background: var(--esun-ui-raised); }
html[data-esd-theme="dark"] :is(.esd-slides-image-dialog, .esd-slides-crop-dialog, .esd-slides-autocomplete, .esd-slides-design-panel, .esd-slides-copy-panel, .esd-slides-workspace .esd-slides-statusbar, .esd-slides-notes-dock) { border-color: var(--esun-ui-line); background: var(--esun-ui-panel); color: var(--esun-ui-ink); }
html[data-esd-theme="dark"] .esd-slides-workspace :is(.esd-slides-ribbon-actions, .esd-slides-ribbon-tabs, .esd-slides-rail, .esd-slides-inspector-head, .esd-slides-inspector-section, .esd-slides-canvas-area) { border-color: var(--esun-ui-line); background: var(--esun-ui-panel); color: var(--esun-ui-ink); }
html[data-esd-theme="dark"] .esd-slides-workspace :is(.esd-slides-mini-title, .esd-slides-item-caption, .esd-slides-selection-bar, .esd-slides-inspector-section label) { color: var(--esun-ui-ink); }
html[data-esd-theme="dark"] .esd-slides-workspace :is(.esd-slides-inspector-tabs, .esd-slides-inspector-tabs button, .esd-slides-position-panel, .esd-slides-design-panel, .esd-slides-inspector-tokens, .esd-slides-notes-dock) { border-color: var(--esun-ui-line); background: var(--esun-ui-panel); color: var(--esun-ui-ink); }
html[data-esd-theme="dark"] .esd-slides-workspace :is(.esd-slides-inspector-section > summary, .esd-slides-design-panel > summary, .esd-slides-inspector-tokens > summary) { background: var(--esun-ui-panel) !important; color: var(--esun-ui-ink); }

/* Proposal and client pages are WordPress pages inside desktop frames. */
html[data-esd-theme="dark"] :is(.esun-propostas-hub, .esun-proposta-modal, .esun-edit-modal) {
  --ph-ink: var(--esun-ui-ink);
  --ph-muted: var(--esun-ui-muted);
  --ph-border: var(--esun-ui-line);
  color-scheme: dark;
  color: var(--esun-ui-ink);
}
html[data-esd-theme="dark"] :is(.esun-propostas-hub, .esun-proposta-modal, .esun-edit-modal, .esun-propostas-toolbar, .esun-proposta-card, .esun-propostas-empty, .esun-propostas-loading-card, .esun-edit-card, .esun-qv-assignment) {
  border-color: var(--esun-ui-line);
  background: var(--esun-ui-panel);
  color: var(--esun-ui-ink);
}
html[data-esd-theme="dark"] :is(.esun-propostas-hub, .esun-proposta-modal, .esun-edit-modal) :is(h2,h3,h4,p,label,strong,small) { color: var(--esun-ui-ink); }
html[data-esd-theme="dark"] :is(.esun-propostas-hub, .esun-proposta-modal, .esun-edit-modal) :is(input:not(.ts-control input), select, textarea) { border-color: var(--esun-ui-line) !important; background: var(--esun-ui-raised) !important; color: var(--esun-ui-ink) !important; }
html[data-esd-theme="dark"] :is(.esun-propostas-hub, .esun-proposta-modal, .esun-edit-modal) input::placeholder { color: var(--esun-ui-muted) !important; opacity: 1; }
html[data-esd-theme="dark"] :is(.esun-info-chip, .esun-qv-grid > div, .esun-edit-preview-grid > div) { border-color: var(--esun-ui-line); background: var(--esun-ui-raised); }
html[data-esd-theme="dark"] :is(.esun-propostas-hub, .esun-proposta-modal, .esun-edit-modal) :is(.esun-btn:not(.esun-btn-primary), .esun-propostas-reset) { border-color: var(--esun-ui-line); background: var(--esun-ui-raised); color: var(--esun-ui-ink) !important; }
html[data-esd-theme="dark"] :is(.esun-propostas-hub, .esun-proposta-modal, .esun-edit-modal) :is(.esun-proposta-badge, .esun-info-chip) { background: var(--esun-ui-raised); color: var(--esun-ui-ink); }
html[data-esd-theme="dark"] :is(.esun-edit-tabs, .esun-edit-preview, .esun-edit-modal-footer) { border-color: var(--esun-ui-line); background: var(--esun-ui-panel); color: var(--esun-ui-ink); }
html[data-esd-theme="dark"] .esun-edit-tab { color: var(--esun-ui-muted); }
html[data-esd-theme="dark"] .esun-edit-tab:hover { background: var(--esun-ui-raised); color: var(--esun-ui-link); }
html[data-esd-theme="dark"] .esun-edit-tab.is-active { background: #0b1b3e; color: #fff; }
html[data-esd-theme="dark"] :is(.esun-propostas-hub, .esun-proposta-modal, .esun-edit-modal) :is(.esun-proposta-card-meta, .esun-proposta-card-sub, .esun-propostas-feedback, .esun-info-chip label, .esun-qv-grid label, .esun-edit-preview-grid label, .esun-edit-hint, .esun-qv-assignment small, .esun-edit-feedback:not(.is-error):not(.is-success)) { color: var(--esun-ui-muted); }
html[data-esd-theme="dark"] .esun-edit-feedback.is-error { color: #ffadad; }
html[data-esd-theme="dark"] .esun-edit-feedback.is-success { color: #8fefbd; }
/* Tom Select has its own control and popup; its inner search must not inherit
   the full-size native-input background, border or padding. */
html[data-esd-theme="dark"] .esun-propostas-hub .ts-control,
html[data-esd-theme="dark"] .esun-proposta-wrap .ts-wrapper.single .ts-control,
html[data-esd-theme="dark"] .esun-clientes-wrap .ts-wrapper.single .ts-control,
html[data-esd-theme="dark"] .esun-clientes-wrap .ts-wrapper.single:hover .ts-control {
  border-color: var(--esun-ui-line) !important;
  background: var(--esun-ui-raised) !important;
  color: var(--esun-ui-ink) !important;
}
html[data-esd-theme="dark"] :is(.esun-propostas-hub, .esun-proposta-wrap, .esun-clientes-wrap) .ts-control :is(.item, .placeholder) { color: var(--esun-ui-ink) !important; }
html[data-esd-theme="dark"] :is(.esun-propostas-hub, .esun-proposta-wrap, .esun-clientes-wrap) .ts-control > input {
  width: auto !important; min-width: 2px !important; min-height: 0 !important;
  margin: 0 !important; padding: 0 !important; border: 0 !important;
  background: transparent !important; color: var(--esun-ui-ink) !important;
  box-shadow: none !important; color-scheme: dark;
}
html[data-esd-theme="dark"] :is(.esun-propostas-hub, .esun-proposta-wrap, .esun-clientes-wrap) .ts-control > input::placeholder { color: var(--esun-ui-muted) !important; opacity: 1; }
html[data-esd-theme="dark"] :is(.esun-propostas-hub, .esun-proposta-wrap, .esun-clientes-wrap) .ts-wrapper.focus .ts-control,
html[data-esd-theme="dark"] .esun-proposta-wrap .ts-control:focus-within { border-color: var(--esun-ui-focus) !important; box-shadow: 0 0 0 3px rgba(255,207,98,.26) !important; outline: 0 !important; }
html[data-esd-theme="dark"] :is(.esun-propostas-hub, .esun-proposta-wrap, .esun-clientes-wrap) .ts-control > input:focus-visible { outline: 0 !important; }
html[data-esd-theme="dark"] :is(.esun-propostas-hub, .esun-proposta-wrap, .esun-clientes-wrap) .ts-wrapper.single .ts-control::after { border-top-color: var(--esun-ui-muted) !important; }
html[data-esd-theme="dark"] .esun-clientes-wrap .ts-wrapper.single .ts-control::after { filter: brightness(0) invert(1); }
html[data-esd-theme="dark"] :is(.esun-propostas-hub, .esun-proposta-wrap, .esun-clientes-wrap) .ts-dropdown {
  border-color: var(--esun-ui-line) !important;
  background: var(--esun-ui-panel) !important;
  color: var(--esun-ui-ink) !important;
}
html[data-esd-theme="dark"] :is(.esun-propostas-hub, .esun-proposta-wrap, .esun-clientes-wrap) .ts-dropdown :is(.option, .create) { border-color: var(--esun-ui-line); background: var(--esun-ui-panel) !important; color: var(--esun-ui-ink) !important; }
html[data-esd-theme="dark"] :is(.esun-propostas-hub, .esun-proposta-wrap, .esun-clientes-wrap) .ts-dropdown :is(.option, .create):is(:hover, .active, .selected) { background: var(--esun-ui-raised) !important; color: var(--esun-ui-ink) !important; }
html[data-esd-theme="dark"] :is(.esun-propostas-hub, .esun-proposta-wrap, .esun-clientes-wrap) .ts-dropdown .no-results { color: var(--esun-ui-muted) !important; }
html[data-esd-theme="dark"] .esun-proposta-wrap { --esun-ink: var(--esun-ui-ink); --esun-muted: var(--esun-ui-muted); --esun-line: var(--esun-ui-line); background: var(--esun-ui-bg); color: var(--esun-ui-ink); color-scheme: dark; }
html[data-esd-theme="dark"] .esun-proposta-wrap :is(input:not(.ts-control input),select,textarea) { border-color: var(--esun-ui-line) !important; background: var(--esun-ui-raised) !important; color: var(--esun-ui-ink) !important; color-scheme: dark; }
html[data-esd-theme="dark"] .esun-proposta-wrap input::placeholder { color: var(--esun-ui-muted) !important; opacity: 1; }
html[data-esd-theme="dark"] .esun-proposta-wrap :is(.esun-proposta-section, .esun-proposta-card, .esun-proposta-panel) { border-color: var(--esun-ui-line); background: var(--esun-ui-panel); color: var(--esun-ui-ink); }
html[data-esd-theme="dark"] .esun-proposta-wrap .esun-proposta-card :is(h3,p,label,strong,small) { color: var(--esun-ui-ink); }
html[data-esd-theme="dark"] .esun-proposta-wrap :is(.esun-steps-nav, .esun-summary-item, .esun-finance-preview, .esun-finance-preview__item, .esun-author-assignment, .esun-form-hint, .esun-kit-composition, .esun-switch label) { border-color: var(--esun-ui-line); background: var(--esun-ui-raised); color: var(--esun-ui-ink); }
html[data-esd-theme="dark"] .esun-proposta-wrap :is(.esun-summary-item strong, .esun-finance-preview__title, .esun-finance-preview__item strong, .esun-steps-nav button:not(.is-active), .esun-doc-status, .esun-doc-pending-choice) { color: var(--esun-ui-ink); }
html[data-esd-theme="dark"] .esun-proposta-wrap :is(.esun-finance-preview__item span, .esun-author-assignment small, .esun-summary-item span, .esun-doc-pending-help, .esun-cep-feedback, .esun-feedback:not(.is-error):not(.is-success)) { color: var(--esun-ui-muted); }
html[data-esd-theme="dark"] .esun-proposta-wrap :is(.esun-steps-nav button:not(.is-active):hover, .esun-switch label:hover, .esun-finance-preview__item.is-highlight, .esun-finance-preview__item.is-sinal, .esun-finance-preview__item.is-final) { background: var(--esun-ui-panel); }
html[data-esd-theme="dark"] .esun-proposta-wrap :is(.esun-finance-preview__item.is-highlight strong, .esun-doc-status.is-valid) { color: #8fefbd; }
html[data-esd-theme="dark"] .esun-proposta-wrap .esun-doc-status.is-invalid { color: #ffadad; }
html[data-esd-theme="dark"] .esun-proposta-wrap .esun-feedback.is-error { color: #ffadad; }
html[data-esd-theme="dark"] .esun-proposta-wrap .esun-feedback.is-success { color: #8fefbd; }
html[data-esd-theme="dark"] .esun-proposta-wrap .esun-field > input:-webkit-autofill { -webkit-text-fill-color: var(--esun-ui-ink) !important; -webkit-box-shadow: 0 0 0 1000px #21334e inset !important; }
html[data-esd-theme="dark"] .esun-proposta-wrap .esun-field > :is(input, select):disabled { opacity: .7; }

/* Light variants of the two legacy CRM screens that shipped dark by default. */
html[data-esd-theme="light"] .esun-clientes-wrap {
  --c-bg: #eff4fb; --c-surface: #fff; --c-surface-raised: #f7faff;
  --c-surface-hover: #e8f1fd; --c-border: #c6d5e7; --c-border-strong: #acbfd8;
  --c-text: #172544; --c-text-soft: #435675; --c-text-muted: #526782;
  background: #eef4fc; box-shadow: 0 12px 34px #15345922;
}
html[data-esd-theme="light"] .esun-cliente-hub {
  --c-bg-0: #eef4fb; --c-bg-1: #f7faff; --c-bg-2: #fff; --c-bg-3: #eaf2fd;
  --c-bg-glass: #fff; --c-bg-glass-2: #f7faff;
  --c-border: #c7d5e8; --c-border-2: #b3c7e2; --c-border-3: #9cb7d9;
  --c-text: #172544; --c-text-2: #435675; --c-text-3: #526782;
  --c-gold-c: #765010;
  --shadow-sm: 0 4px 16px #15345916; --shadow-md: 0 10px 28px #15345922;
}
html[data-esd-theme="light"] .esun-clientes-wrap :is(.esun-clientes-shell, .esun-clientes-sidebar, .esun-client-row),
html[data-esd-theme="light"] .esun-cliente-hub .esun-g-card { border-color: var(--c-border); background: #fff; }
html[data-esd-theme="light"] .esun-clientes-wrap :is(.esun-clientes-toolbar, .esun-clientes-filters--sidebar) { border-color: var(--c-border); background: #f7faff; }
html[data-esd-theme="light"] .esun-clientes-wrap :is(input, select, textarea):not(.esun-client-modal *) { color: #172544 !important; border-color: #b3c7e2 !important; background: #fff !important; }
html[data-esd-theme="light"] .esun-clientes-wrap .esun-filter-field select:not(.esun-client-modal *) { appearance: auto !important; background-image: none !important; padding-right: 14px !important; }
html[data-esd-theme="light"] .esun-clientes-wrap :is(.esun-data-pair__label, .esun-client-row__last-update) { color: #526782; }
html[data-esd-theme="light"] .esun-clientes-wrap :is(.esun-data-pair__value, .esun-client-login-alert) { color: #172544; }
html[data-esd-theme="light"] .esun-clientes-wrap .esun-client-row__avatar { color: #6b4500; }
html[data-esd-theme="light"] .esun-clientes-wrap .esun-pill { border-color: #c4d3e7; background: #edf3fa; color: #294562; }
html[data-esd-theme="light"] .esun-clientes-wrap .esun-pill--accent { border-color: #dfbf72; background: #fff2ce; color: #65440c; }
html[data-esd-theme="light"] .esun-clientes-wrap .esun-pill--funil { border-color: #a7c4e8; background: #e8f1ff; color: #174494; }
html[data-esd-theme="light"] .esun-clientes-wrap .esun-pill--proposal.is-has-proposal { border-color: #8dc8aa; background: #e7f7ee; color: #135c3a; }
html[data-esd-theme="light"] .esun-clientes-wrap .esun-pill--proposal.is-no-proposal { color: #435675; }
/* The client hero and legacy dialogs have their own dark visual language. Their
   light text stays on a dark surface while the rest of the CRM is light. */
html[data-esd-theme="light"] .esun-cliente-hub .esun-cliente-hub__hero,
html[data-esd-theme="light"] .esun-client-modal,
html[data-esd-theme="light"] .esun-hub-modal,
html[data-esd-theme="light"] .esun-hub-doc-modal {
  --c-text: #f0f4ff; --c-text-soft: #c4d4e9; --c-text-muted: #a7bad4;
  --c-text-2: #c4d4e9; --c-text-3: #a7bad4; --c-gold-c: #ffe08a;
}
html[data-esd-theme="light"] .esun-cliente-hub .esun-cliente-hub__hero { border-color: #355070; background: linear-gradient(135deg, #102548, #183766); }

/* Document lists and controls; authored paper remains white. */
html[data-esd-theme="dark"] :is(.esd-portal-shell .esd-card, .esd-portal-table td, .esd-portal-table th, .esd-metrics article, .esd-pagination .page-numbers) { border-color: var(--esun-ui-line); background: var(--esun-ui-panel); color: var(--esun-ui-ink); }
html[data-esd-theme="dark"] .esd-portal-shell :is(.esd-heading, .esd-portal-wrap) :is(h1,h2,h3,h4,h5,h6,p,small,label,th,td,strong,legend,summary):where(:not(.esd-sheet-grid *):not(.esd-sheet-paper *):not(.esd-sheet-print-page *):not(.esd-slide-canvas *):not(.esd-builder-page *):not(.esd-appearance-preview *)) { color:var(--esun-ui-ink); }
html[data-esd-theme="dark"] .esd-portal-shell :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea) { border-color: var(--esun-ui-line); background: var(--esun-ui-raised); color: var(--esun-ui-ink); }
html[data-esd-theme="dark"] .esd-portal-shell :is(input,textarea)::placeholder { color:var(--esun-ui-muted);opacity:1; }
html[data-esd-theme="dark"] .esd-portal-shell :is(a:not(.button), .button-link) { color: var(--esun-ui-link); }
/* Legacy UI colors need paired surfaces and ink. Inline icons and status chips
   inherit their component's color instead of a blanket white span rule. */
html[data-esd-theme="dark"] .esd-portal-shell .button:not(.esd-primary):not(.button-primary) {
  border-color:var(--esun-ui-line);background:var(--esun-ui-raised);color:var(--esun-ui-ink);
}
html[data-esd-theme="dark"] .esd-portal-shell .button:not(.esd-primary):not(.button-primary):is(:hover,:focus-visible) {
  border-color:var(--esun-ui-link);background:var(--esun-ui-soft);color:var(--esun-ui-soft-ink);
}
html[data-esd-theme="dark"] :is(.esd-docs-library,.esd-sheets-library) { background:var(--esun-ui-bg);color:var(--esun-ui-ink); }
html[data-esd-theme="dark"] :is(.esd-docs-library-nav,.esd-sheets-library-nav) { border-color:var(--esun-ui-line);background:var(--esun-ui-panel);color:var(--esun-ui-ink); }
html[data-esd-theme="dark"] :is(.esd-docs-library,.esd-sheets-library) :is(.esd-docs-library-brand strong,.esd-sheets-library-brand strong,.esd-docs-library-head h1,.esd-sheets-library-head h1,.esd-list-card-head h2) { color:var(--esun-ui-ink); }
html[data-esd-theme] :is(.esd-docs-library,.esd-sheets-library) :is(.esd-docs-library-brand small,.esd-sheets-library-brand small,.esd-docs-library-head p,.esd-sheets-library-head p,.esd-docs-library-foot small,.esd-sheets-storage small,.esd-docs-filter-field>label,.esd-results-meta p,.esd-results-meta strong,.esd-list-card-head small,.esd-sheets-list-card header small,.esd-document-identity small) { color:var(--esun-ui-muted); }
html[data-esd-theme="dark"] :is(.esd-docs-library,.esd-sheets-library) .esd-library-eyebrow { color:var(--esun-ui-link); }
html[data-esd-theme="dark"] :is(.esd-docs-library-nav,.esd-sheets-library-nav) nav>:is(a,span) { color:var(--esun-ui-ink)!important; }
html[data-esd-theme="dark"] :is(.esd-docs-library-nav,.esd-sheets-library-nav) nav>a:is(:hover,:focus-visible,.is-active) { background:var(--esun-ui-soft);color:var(--esun-ui-soft-ink)!important; }
html[data-esd-theme="dark"] :is(.esd-docs-library-nav,.esd-sheets-library-nav) nav>a.is-active { box-shadow:inset 3px 0 var(--esun-ui-link); }
html[data-esd-theme="dark"] :is(.esd-docs-library-nav,.esd-sheets-library-nav) nav>:is(a,span)>span { color:inherit; }
html[data-esd-theme="dark"] :is(.esd-docs-library-nav,.esd-sheets-library-nav) nav em { background:var(--esun-ui-raised);color:var(--esun-ui-ink); }
html[data-esd-theme="dark"] :is(.esd-docs-library-nav,.esd-sheets-library-nav) nav>a.is-active em { background:var(--esun-ui-panel);color:var(--esun-ui-link); }
html[data-esd-theme="dark"] .esd-docs-library :is(.esd-docs-library-foot,.esd-list-card-head,.esd-portal-table tbody tr,.esd-portal-table .esd-actions) { border-color:var(--esun-ui-line); }
html[data-esd-theme="dark"] :is(.esd-docs-view-controls,.esd-sheet-view-controls) { border-color:var(--esun-ui-line);background:var(--esun-ui-panel); }
html[data-esd-theme="dark"] :is(.esd-docs-view-controls,.esd-sheet-view-controls) button { background:transparent;color:var(--esun-ui-muted); }
html[data-esd-theme="dark"] :is(.esd-docs-view-controls,.esd-sheet-view-controls) button.is-active { background:var(--esun-ui-soft);color:var(--esun-ui-soft-ink); }
html[data-esd-theme="dark"] :is(.esd-docs-library,.esd-sheets-library) :is(.esd-list-card-head>div>span,.esd-document-mini-icon,.esd-sheets-list-card>header>div>span,.esd-sheet-file-name>span) { background:var(--esun-ui-soft);color:var(--esun-ui-soft-ink); }
html[data-esd-theme="dark"] .esd-docs-library .esd-search-field>span { color:var(--esun-ui-muted); }
html[data-esd-theme="dark"] .esd-portal-table td[data-label]::before,
html[data-esd-theme="dark"] .esd-docs-library-content .esd-portal-table td[data-label]:not(.esd-actions):not(:first-child)::before { color:var(--esun-ui-muted); }
html[data-esd-theme="dark"] .esd-portal-table tbody tr:hover td { background:var(--esun-ui-raised); }
html[data-esd-theme="dark"] .esd-portal-table .esd-actions a { border-color:var(--esun-ui-line);background:var(--esun-ui-raised);color:var(--esun-ui-link); }
html[data-esd-theme="dark"] .esd-portal-table .esd-actions a:is(:hover,:focus-visible) { border-color:var(--esun-ui-link);background:var(--esun-ui-soft); }
html[data-esd-theme="dark"] .esd-portal-shell :is(.esd-danger-link,.button-link-delete) { color:var(--esun-ui-danger)!important; }
html[data-esd-theme="dark"] .esd-portal-shell .esd-status-draft { background:var(--esun-ui-raised);color:var(--esun-ui-muted); }
html[data-esd-theme="dark"] .esd-portal-shell .esd-status-issued { background:var(--esun-ui-soft);color:var(--esun-ui-soft-ink); }
html[data-esd-theme="dark"] .esd-portal-shell .esd-status-paid { background:#123c30;color:#9ae6bd; }
html[data-esd-theme="dark"] .esd-portal-shell .esd-status-cancelled { background:#4a2331;color:#ffb4c1; }
html[data-esd-theme="dark"] .esd-sheets-library :is(.esd-sheets-storage,.esd-sheets-list-card>header,.esd-sheet-file-table tbody tr,.esd-sheet-file-table td) { border-color:var(--esun-ui-line); }
html[data-esd-theme="dark"] .esd-sheets-library :is(.esd-sheets-list-card h2,.esd-sheet-file-table td,.esd-sheets-storage strong) { color:var(--esun-ui-ink); }
html[data-esd-theme] .esd-sheets-library .esd-sheet-file-table th { border-color:var(--esun-ui-line);background:var(--esun-ui-raised);color:var(--esun-ui-muted); }
html[data-esd-theme="dark"] .esd-sheets-library .esd-sheet-file-table tbody tr:hover td { background:var(--esun-ui-raised); }
html[data-esd-theme] .esd-sheets-library .esd-sheet-file-table td::before,
html[data-esd-theme] .esd-sheets-library .esd-sheet-file-table td small { color:var(--esun-ui-muted); }
html[data-esd-theme="dark"] .esd-sheets-library .esd-sheet-file-name { color:var(--esun-ui-ink)!important; }
html[data-esd-theme="dark"] .esd-sheets-library .esd-sheet-row-actions>a:not(.esd-danger-link) { color:var(--esun-ui-link)!important; }
html[data-esd-theme="dark"] .esd-sheets-library .esd-sheet-row-actions>a:is(:hover,:focus-visible) { background:var(--esun-ui-soft); }
/* The upload and progress UI stays dark; PDF pages and signature canvases keep
   their original colors. These selectors never target the public signing page. */
html[data-esd-theme="dark"] :is(.esd-sign-app,.esd-mail-app) { color:var(--esun-ui-ink); }
html[data-esd-theme="dark"] .esd-sign-app :is(.esd-sign-drop,.esd-sign-place-step.is-expanded,.esd-sign-placement-person) { border-color:var(--esun-ui-line);background:var(--esun-ui-raised);color:var(--esun-ui-ink); }
html[data-esd-theme="dark"] .esd-sign-app .esd-sign-drop:is(:hover,.is-dragover) { border-color:var(--esun-ui-link);background:var(--esun-ui-soft); }
html[data-esd-theme="dark"] .esd-sign-app :is(.esd-sign-drop span,.esd-sign-placement-person small) { color:var(--esun-ui-muted); }
html[data-esd-theme="dark"] .esd-sign-app :is(.esd-sign-drop strong,.esd-sign-placement-person strong) { color:var(--esun-ui-ink); }
html[data-esd-theme="dark"] .esd-sign-app :is(.esd-sign-status,.esd-sign-placement-person.is-active) { background:var(--esun-ui-soft);color:var(--esun-ui-soft-ink); }
html[data-esd-theme="dark"] .esd-sign-app :is(.esd-sign-steps,.esd-sign-step-actions) { border-color:var(--esun-ui-line); }
html[data-esd-theme="dark"] .esd-sign-app .esd-sign-steps button>span { background:var(--esun-ui-raised);color:var(--esun-ui-ink); }
html[data-esd-theme="dark"] .esd-sign-app .esd-sign-steps button[aria-current="step"] { border-color:var(--esun-ui-link);background:var(--esun-ui-soft);color:var(--esun-ui-soft-ink); }
html[data-esd-theme="dark"] .esd-sign-app .esd-sign-steps button[aria-current="step"]>span { background:#2357db;color:#fff; }
html[data-esd-theme="dark"] .esd-sign-app .esd-sign-steps button.is-done>span { background:#123c30;color:#9ae6bd; }
html[data-esd-theme="dark"] .esd-sign-app .esd-sign-auth-note { border-color:var(--esun-ui-line);background:var(--esun-ui-raised);color:var(--esun-ui-muted)!important; }
html[data-esd-theme="dark"] :is(.esd-sign-app .esd-sign-document-status,.esd-mail-app .esd-mail-notice) { border-color:#35785b;background:#123c30;color:#9ae6bd!important; }
html[data-esd-theme="dark"] :is(.esd-sign-app .esd-sign-document-status.is-error,.esd-sign-app .esd-sign-feedback,.esd-mail-app .esd-mail-notice.is-error) { border-color:#965566;background:#4a2331;color:#ffb4c1!important; }
html[data-esd-theme="dark"] :is(.esd-sheets-summary article, .esd-sheet-file-card, .esd-sheet-editor, .esd-sheet-editor-head, .esd-sheet-guide-panel, .esd-sheet-guide-panel > header, .esd-sheet-autocomplete) { border-color: var(--esun-ui-line); background: var(--esun-ui-panel); color: var(--esun-ui-ink); }
html[data-esd-theme="dark"] :is(.esd-sheet-file-card footer, .esd-sheet-toolbar, .esd-sheet-guide-tip) { border-color: var(--esun-ui-line); background: var(--esun-ui-raised); color: var(--esun-ui-ink); }
html[data-esd-theme="dark"] :is(.esd-sheets-summary strong, .esd-sheets-summary small, .esd-sheet-file-main, .esd-sheet-file-main strong, .esd-sheet-file-main small, .esd-sheets-list-card h2, .esd-sheet-guide-panel h2, .esd-sheet-guide-panel p, .esd-sheet-toolbar button) { color: var(--esun-ui-ink) !important; }
html[data-esd-theme="dark"] .esd-sheet-title-line input { color: var(--esun-ui-ink) !important; }
html[data-esd-theme="dark"] .esd-sheet-grid-wrap { background: var(--esun-ui-panel); }
html[data-esd-theme="dark"] .esd-sheet-grid :is(thead th,tbody th) { border-color: var(--esun-ui-line); background: var(--esun-ui-raised); color: var(--esun-ui-muted); }
html[data-esd-theme="dark"] .esd-sheet-grid td:not([style]) { border-color: var(--esun-ui-line); background: var(--esun-ui-panel); color: var(--esun-ui-ink); }
html[data-esd-theme="dark"] .esd-sheet-grid td:not([style]):hover { background: var(--esun-ui-raised); }
html[data-esd-theme="dark"] :is(.esd-builder-palette, .esd-builder-inspector) { border-color: var(--esun-ui-line); background: var(--esun-ui-panel); color: var(--esun-ui-ink); }
html[data-esd-theme="dark"] :is(.esd-builder-panel-head, .esd-builder-panel-section, .esd-builder-components button) { border-color: var(--esun-ui-line); background: var(--esun-ui-panel); color: var(--esun-ui-ink); }
html[data-esd-theme="dark"] .esd-builder-workspace { background: #2b3b56; }
html[data-esd-theme="dark"] .esd-visual-builder :is(.esd-builder-panel-head strong, .esd-builder-panel-head span) { color: var(--esun-ui-ink); }

/* Visible focus and reduced motion apply equally to both choices. */
html[data-esd-theme] :is(.esd-portal-app, .esd-portal-shell, .esd-account, .esd-studio, .esd-desktop-embed, .esd-sign-app, .esd-mail-app, .esun-clientes-wrap, .esun-propostas-hub) :is(a,button,input,select,textarea,summary,[tabindex]):focus-visible {
  outline: 3px solid var(--esun-ui-focus) !important;
  outline-offset: 2px !important;
}
html[data-esd-theme] .esd-theme-chooser button:focus-visible { outline: 3px solid var(--esun-ui-focus) !important; outline-offset: 2px !important; }
@media (prefers-reduced-motion: reduce) {
  html[data-esd-theme] { scroll-behavior: auto !important; }
  html[data-esd-theme] :is(.esd-portal-app, .esd-studio, .esd-account, .esd-reports, .esd-desktop-embed) *,
  html[data-esd-theme] :is(.esd-portal-app, .esd-studio, .esd-account, .esd-reports, .esd-desktop-embed) *::before,
  html[data-esd-theme] :is(.esd-portal-app, .esd-studio, .esd-account, .esd-reports, .esd-desktop-embed) *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Controles e marcadores não podem herdar texto claro sobre fundos claros. */
html[data-esd-theme] .esd-account-fold>summary>span:first-child,
html[data-esd-theme] .esd-account-fold>summary::after {
  background:var(--esun-ui-soft);color:var(--esun-ui-soft-ink)!important;
}
html[data-esd-theme] .esd-account .esd-account-photo>span { color:#173258; }
html[data-esd-theme] .esd-account .esd-account-button.is-primary,
html[data-esd-theme] .esd-account .esd-account-button.is-primary * {
  border-color:#e5ad22!important;background:#ffc63f!important;color:#182c4d!important;
}
html[data-esd-theme] .esd-account .esd-account-button.is-primary:hover { background:#ffda78!important; }
html[data-esd-theme] .esd-os-window-loader { background:var(--esun-ui-bg);color:var(--esun-ui-muted); }
html[data-esd-theme] .esd-os-window-loader strong { color:var(--esun-ui-ink); }
html[data-esd-theme] .esd-os-loader-actions :is(button,a) {
  background:var(--esun-ui-panel);color:var(--esun-ui-link);border-color:var(--esun-ui-line);
}
html[data-esd-theme="dark"] :is(.esd-studio,.esd-sign-app,.esd-mail-app) :is(.esd-studio-secondary,.esd-sign-light,.esd-mail-secondary) {
  border-color:var(--esun-ui-line)!important;background:var(--esun-ui-raised)!important;color:var(--esun-ui-ink)!important;
}
html[data-esd-theme="dark"] .esd-studio :is(.esd-studio-row-icon,.esd-studio-example-grid>a,.esd-studio-examples) {
  border-color:var(--esun-ui-line);background:var(--esun-ui-panel);color:var(--esun-ui-link);
}
html[data-esd-theme] .esd-studio :is(label,legend) { font-size:12px;line-height:1.5; }
html[data-esd-theme] .esd-studio .esd-studio-toggle {
  display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:10px;min-height:32px;line-height:1.5;
}
html[data-esd-theme] .esd-studio .esd-studio-toggle input { flex:0 0 auto;width:18px;height:18px;min-height:18px;margin:0; }
html[data-esd-theme] :is(.esd-studio,.esd-account,.esd-portal-shell) input:is([type="checkbox"],[type="radio"]) { accent-color:#3868f5; }
html[data-esd-theme="dark"] .esd-slides-workspace :is(.esd-slides-inspector-tabs,.esd-slides-ribbon-tabs,.esd-slides-ribbon-panel,.esd-slides-ribbon-group,.esd-slides-ribbon-content) {
  border-color:var(--esun-ui-line);background:var(--esun-ui-panel);color:var(--esun-ui-ink);
}
html[data-esd-theme="dark"] .esd-slides-workspace :is(.esd-slides-ribbon-tabs,.esd-slides-inspector-tabs) button[aria-selected="true"] {
  background:var(--esun-ui-soft)!important;color:var(--esun-ui-soft-ink)!important;box-shadow:inset 0 -3px #83b9ff;
}
html[data-esd-theme="dark"] .esd-sheet-editor :is(.esd-sheet-ribbon,.esd-sheet-ribbon-tabs,.esd-sheet-ribbon-panel,.esd-sheet-ribbon-group,.esd-sheet-formula-bar,.esd-sheet-tabs-footer,.esd-sheet-statusbar) {
  border-color:var(--esun-ui-line);background:var(--esun-ui-panel);color:var(--esun-ui-ink);
}
html[data-esd-theme="dark"] .esd-sheet-editor :is(.esd-sheet-ribbon-tabs,.esd-sheet-toolbar) button,
html[data-esd-theme="dark"] .esd-sheet-editor :is(.esd-sheet-ribbon-group-label,.esd-sheet-tab,.esd-sheet-statusbar) {
  color:var(--esun-ui-ink)!important;
}
html[data-esd-theme="dark"] .esd-sheet-editor :is(.esd-sheet-ribbon-tabs button,.esd-sheet-tab).is-active {
  background:var(--esun-ui-soft);color:var(--esun-ui-soft-ink)!important;
}
html[data-esd-theme="dark"] .esd-visual-builder :is(.esd-builder-panel-section label,.esd-builder-panel-section small,.esd-builder-components button) { color:var(--esun-ui-ink); }
html[data-esd-theme="dark"] :is(.esd-account,.esd-reports,.esd-studio,.esd-sign-app,.esd-mail-app) [role="status"].is-error { color:var(--esun-ui-danger); }
html[data-esd-theme] .esd-appearance-preview :is(span,strong,small) { color:inherit; }
html[data-esd-theme="dark"] :is(.esd-builder-page,.esd-slide-canvas,.esd-sheet-print-page) { color-scheme:light; }
