/* The workspace palette is independent of the colors rendered inside a slide. */
:root {
  --cm-primary: var(--cm-org-primary, #003b4d);
  --cm-accent: var(--cm-org-accent, #dd753e);
  --cm-warm: var(--cm-org-warm, #b4552c);
  --cm-ink: var(--cm-org-ink, #123948);
  --cm-bg: var(--cm-org-bg, #f8f8f6);
  --cm-font: var(--cm-org-font, "DM Sans", system-ui, sans-serif);
  --cm-heading-font: var(--cm-org-heading-font, Manrope, var(--cm-font));
  --ui-link: var(--cm-primary);
  --ui-hover: color-mix(in srgb, var(--cm-primary) 8%, var(--cm-white));
  --ui-nav-start: color-mix(in srgb, var(--cm-bg) 72%, var(--cm-white));
  --ui-nav-end: color-mix(in srgb, var(--cm-bg) 94%, var(--cm-primary));
  --ui-switch-off: #65747b;
  --ui-shadow: #10293727;
}
:root[data-color-mode="dark"] {
  color-scheme: dark;
  --cm-bg: #111318;
  --cm-white: #191d25;
  --cm-ink: #eef1f6;
  --cm-muted: #a9b4c4;
  --cm-border: #343d4b;
  --cm-soft: #242c3a;
  --cm-primary: #3b5dc7;
  --cm-accent: #a4b7ff;
  --cm-warm: #b5c5ff;
  --cm-font: system-ui, sans-serif;
  --cm-heading-font: var(--cm-font);
  --ui-link: #b5c5ff;
  --ui-nav-start: #181c23;
  --ui-nav-end: #151922;
  --ui-hover: #283246;
  --ui-switch-off: #626f84;
  --ui-shadow: #0008;
  --ui-field: #151a22;
  --ui-field-border: #5b687d;
  --ui-inset: #202632;
  --ui-warning: #f0c795;
  --ui-warning-bg: #36271e;
  --ui-warning-line: #725035;
  --ui-danger: #ffb7b5;
  --ui-danger-bg: #372326;
  --ui-danger-line: #79474b;
  --ui-success: #a9dfc9;
  --ui-success-bg: #1a302c;
  --ui-success-line: #416c5f;
}
.app-nav { background: linear-gradient(180deg,var(--ui-nav-start),var(--ui-nav-end)); }
.product-brand strong { color: var(--ui-link); font-family: var(--cm-heading-font); }
.nav-link.active { color: var(--ui-link); background: var(--ui-hover); border-color: var(--cm-border); }
.nav-foot { flex: none; }
.nav-foot-context { display: grid; gap: 8px; padding-inline: 5px; }
.theme-switch {
  display: flex; align-items: center; justify-content: space-between; gap: 5px;
  min-height: 41px; width: 100%; padding: 6px 8px; border: 1px solid transparent;
  border-radius: 8px; background: transparent; color: var(--cm-ink);
  text-align: left; font-size: 12px; font-weight: 740;
}
.theme-switch:hover { background: var(--ui-hover); border-color: var(--cm-border); }
.theme-switch-label { display: flex; align-items: center; gap: 8px; }
.theme-switch-label svg { width: 16px; height: 16px; color: var(--ui-link); }
.theme-switch-track {
  display: flex; align-items: center; flex: none; width: 33px; height: 19px; padding: 3px;
  border-radius: 99px; background: var(--ui-switch-off);
}
.theme-switch-track::after {
  content: ""; width: 13px; height: 13px; border-radius: 50%; background: #fff;
  transition: transform .15s;
}
.theme-switch[aria-checked="true"] .theme-switch-track { background: var(--cm-primary); outline: 1px solid var(--cm-accent); }
.theme-switch[aria-checked="true"] .theme-switch-track::after { transform: translateX(14px); }
.creation-dropdown { position: relative; }
.creation-dropdown summary { list-style: none; user-select: none; }
.creation-dropdown summary::-webkit-details-marker { display: none; }
.creation-dropdown summary svg:last-child { width: 15px; height: 15px; }
.creation-dropdown[open] summary svg:last-child { transform: rotate(180deg); }
.creation-options {
  position: absolute; z-index: 5; inset-block-start: calc(100% + 6px); inset-inline-end: 0;
  min-width: 216px; padding: 5px; margin: 0; list-style: none; border: 1px solid var(--cm-border);
  border-radius: 10px; background: var(--cm-white); box-shadow: 0 9px 26px var(--ui-shadow);
}
.creation-options a {
  display: flex; align-items: center; gap: 9px; min-height: 41px; padding: 5px 9px;
  border-radius: 6px; color: var(--cm-ink); font-size: 13px; font-weight: 720; white-space: nowrap;
}
.creation-options a:hover,.creation-options a:focus-visible { background: var(--ui-hover); }
.creation-options a svg { width: 16px; height: 16px; color: var(--ui-link); }
@media (min-width:761px) {
  .sidebar-collapsed .theme-switch { justify-content: center; padding-inline: 0; }
  .sidebar-collapsed .theme-switch-label { display: none; }
}
@media (max-width:515px) {
  .creation-options { inset-inline: 0 auto; }
  .creation-dropdown summary { min-height: 39px; }
}

/* Legacy chrome surfaces use these neutral dark counterparts. Stage, QR and projector
   colors stay as authored. Public pages do not load the stored color-mode preference. */
[data-color-mode="dark"] :is(.app-nav,.app-topbar,.nav-foot,.sidebar-toggle,.card-head,.quick-item+.quick-item,
  .members-list li+li,td,.review-list li+li,.catalog-list li,.bible-editions>li+li,
  .editor-panel-head,.editor-order-actions,.editor-stage-toolbar,.editor-stage-hint,.editor-mobile-settings,
  .editor-library-result,.login-identity,.login-note,.swatch-row i) { border-color: var(--cm-border); }
[data-color-mode="dark"] :is(.nav-link,.nav-label,.nav-foot,.org-select span,.environment-pill,.breadcrumb,.breadcrumb svg,
  .icon-btn,.quick-item small,.quick-item>svg,.deck-name small,td,th,.form-grid label small,.logo-field small,.choice small,
  .import-theme,.catalog-meta,.catalog-visibility,.editor-slide-count,.login-note) { color: var(--cm-muted); }
[data-color-mode="dark"] :is(.nav-link.active,.profile-link:hover,.profile-link[aria-current=page],.quiet-btn,.btn-outline,
  .bible-format summary,.mob-publish legend,.editor-slide-mobile,.editor-sharing-details svg,.upload-block>svg,.login-kicker,.login-app) { color: var(--ui-link); }
[data-color-mode="dark"] :is(.sidebar-toggle,.btn-outline,.account-dialog,.login-shell) { background: var(--cm-white); }
[data-color-mode="dark"] .btn-outline { border-color: var(--ui-field-border); }
[data-color-mode="dark"] :is(.nav-link:hover,.nav-link.active,.profile-link:hover,.profile-link[aria-current=page],.quiet-btn:hover,
  .btn-outline:hover:not(:disabled),.icon-btn:hover:not(:disabled)) { background: var(--ui-hover); border-color: var(--cm-border); }
[data-color-mode="dark"] :is(.avatar,.count,.date-tag,.tile-small,.tile-small.orange,.blank-icon,.seq,.layout-token,.layout-token.muted-token,
  .bible-edition-name>.bible-edition-default,.bible-status,.editor-count,.editor-library-availability) {
  background: var(--cm-soft); border-color: var(--cm-border); color: var(--ui-link);
}
[data-color-mode="dark"] .brand-mark { color: var(--ui-link); border-color: var(--cm-border); background: var(--ui-inset); }
[data-color-mode="dark"] .brand-mark:has(img),[data-color-mode="dark"] .login-logo { background: #eceff5; }
[data-color-mode="dark"] .login-logo { border-radius: 12px; }
[data-color-mode="dark"] .hero-card { background: linear-gradient(135deg,#232840,#303e60); }
[data-color-mode="dark"] .art-screen { background: #343e5d; border-color: #66779c; box-shadow: 0 18px 40px #111318a0; }
[data-color-mode="dark"] :is(.art-line,.art-tiles i) { background: #7184b0; }
[data-color-mode="dark"] .art-overline { background: var(--cm-accent); }
[data-color-mode="dark"] :is(th,.upload-block,.mob-publish,.bible-format pre,.import-preview,.layout-preview,#identity-slide,
  .editor-details,.editor-stage-hint,.login-identity) { background: var(--ui-inset); }
[data-color-mode="dark"] :is(.form-grid label:not(.choice),.logo-field) { color: var(--cm-ink); }
[data-color-mode="dark"] :is(input:not([type=checkbox]):not([type=radio]),select,textarea) {
  background: var(--ui-field); border-color: var(--ui-field-border); color: var(--cm-ink);
}
[data-color-mode="dark"] :is(input,select,textarea):focus { border-color: var(--cm-accent); }
[data-color-mode="dark"] :is(input,textarea)::placeholder { color: var(--cm-muted); }
[data-color-mode="dark"] input[type=file]::file-selector-button { background: var(--cm-soft); color: var(--cm-ink); }
[data-color-mode="dark"] :is(.upload-block,.mob-publish) { border-color: var(--ui-field-border); }
[data-color-mode="dark"] :is(.notice,.bible-import-preview) { background: var(--cm-soft); border-color: var(--cm-border); color: var(--cm-ink); }
[data-color-mode="dark"] :is(.member-pending,.notice.warning,.bible-status[data-source=missing],.bible-replace,.toast.warning,.import-warnings,
  .editor-conflict,.editor-library-unavailable,.live-operator-note,.live-interlude,.live-alert,
  .live-edit-status[data-error=true],.live-edit-warning,.live-visibility[data-attention=true]) {
  color: var(--ui-warning); background: var(--ui-warning-bg); border-color: var(--ui-warning-line);
}
[data-color-mode="dark"] :is(.notice.error,.bible-import-preview[data-kind=error],.toast.error,
  .icon-btn.danger:hover:not(:disabled),.editor-btn-danger:hover:not(:disabled),.live-danger:hover) {
  color: var(--ui-danger); background: var(--ui-danger-bg); border-color: var(--ui-danger-line);
}
[data-color-mode="dark"] :is(.toast:not(.warning):not(.error),.notice.bible-result,.bible-status[data-source=organization],.live-pill[data-live=true]) {
  color: var(--ui-success); background: var(--ui-success-bg); border-color: var(--ui-success-line);
}
[data-color-mode="dark"] .layout-foot .layout-assigned { color: var(--ui-success); }
[data-color-mode="dark"] :is(.login-error,.editor-btn-danger,.live-danger) { color: var(--ui-danger); }
[data-color-mode="dark"] :is(.editor-unsaved,.editor-layout-requirement,.live-output-feedback[data-warning=true]) { color: var(--ui-warning); }
[data-color-mode="dark"] :is(.editor-tag,.login-app svg) { color: var(--cm-warm); }
[data-color-mode="dark"] :is(.presentation-editor,.live-operator .editor-library) {
  --ed-ink: var(--cm-ink); --ed-muted: var(--cm-muted); --ed-border: var(--cm-border);
  --ed-subtle: var(--ui-inset); --ed-accent: var(--cm-accent);
}
[data-color-mode="dark"] .live-operator { --live-surface: var(--cm-white); --live-soft: var(--ui-inset); }
[data-color-mode="dark"] :is(.editor-btn:not(.editor-btn-primary):not(.editor-btn-quiet),.editor-panel,.editor-slide,.editor-sharing,
  .editor-library,.editor-crop,.editor-download-options) { background: var(--cm-white); }
[data-color-mode="dark"] :is(.editor-btn:not(.editor-btn-primary):not(.editor-btn-danger):hover:not(:disabled),.editor-slide:hover,.editor-slide-active) { background: var(--ui-hover); }
[data-color-mode="dark"] .editor-canvas-wrap { background: radial-gradient(circle,#4c566e 1px,transparent 1px) 0 0 / 14px 14px,#12161e; }
[data-color-mode="dark"] .editor-canvas-wrap>.slide-stage { box-shadow: 0 6px 24px #0008,0 0 0 1px var(--cm-border); }
[data-color-mode="dark"] :is(.editor-btn,.editor-slide,.editor-details summary,.live-btn,.live-field):focus-visible { outline-color: var(--cm-accent); }
[data-color-mode="dark"] .editor-crop-preview { background: repeating-conic-gradient(#353e50 0 25%,#202632 0 50%) 0/14px 14px; }
[data-color-mode="dark"] .live-visibility:not([data-attention=true]) { background: var(--ui-inset); border-color: var(--cm-border); }
[data-color-mode="dark"] ::selection { background: #364674; color: var(--cm-ink); }
