/* Light palette: the default theme. Jodit marks its editor, popups and
   dialogs jodit_theme_default; they keep this palette in the dark theme so a
   letter is edited as it is read. */
:root,
.jodit_theme_default {
  color-scheme: light;
  --color-bg: #f7f4ef;
  --color-fg: #2c3a4a;
  --color-muted: #4a5a6a;
  --color-border: #c5c0b8;
  --color-accent: #3d5c73;
  --color-danger: #8b0000;
  --color-ok: #0b5;
  --color-ok-soft: #e6f4ea; /* notice background; text stays --color-fg */
  --color-danger-soft: #f8e8e8;
  --color-warn: #b7791f; /* not yet in effect: an unpublished draft */
  --color-warn-soft: #fbf0d3;
  --color-hl: #f5e27a; /* search match; color stays inherit */
  --color-btn-bg: #2c3a4a;
  --color-btn-fg: #f7f4ef;
  --logo-filter: none;
  --image-filter: none;
  /* The theme button offers the other theme. */
  --theme-to-dark: inline-flex;
  --theme-to-light: none;
}

/* Dark palette. The two blocks below must stay identical
   (TestDarkPaletteBlocksMatch): the first follows the system when no choice
   is stored, the second is the stored choice (lr_theme cookie). Text is soft
   white on slate, not pure white on black. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --color-bg: #1c232b;
    --color-fg: #d5dbe1;
    --color-muted: #9ba8b4;
    --color-border: #3b4652;
    --color-accent: #93b4cc;
    --color-danger: #ef9a9a;
    --color-ok: #5cbf8a;
    --color-ok-soft: #1e3329;
    --color-danger-soft: #3b2427;
    --color-warn: #e0b252;
    --color-warn-soft: #3a3120;
    --color-hl: #6e5c1c;
    --color-btn-bg: #3d5c73;
    --color-btn-fg: #eef2f5;
    --logo-filter: brightness(0) invert(1);
    --image-filter: brightness(0.88);
    --theme-to-dark: none;
    --theme-to-light: inline-flex;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --color-bg: #1c232b;
  --color-fg: #d5dbe1;
  --color-muted: #9ba8b4;
  --color-border: #3b4652;
  --color-accent: #93b4cc;
  --color-danger: #ef9a9a;
  --color-ok: #5cbf8a;
  --color-ok-soft: #1e3329;
  --color-danger-soft: #3b2427;
  --color-warn: #e0b252;
  --color-warn-soft: #3a3120;
  --color-hl: #6e5c1c;
  --color-btn-bg: #3d5c73;
  --color-btn-fg: #eef2f5;
  --logo-filter: brightness(0) invert(1);
  --image-filter: brightness(0.88);
  --theme-to-dark: none;
  --theme-to-light: inline-flex;
}

:root {
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --touch: 2.75rem;
  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
  --measure: 42rem;
  --print-tile: 12rem; /* key-page thumb; catalog stays 4rem */
  --page-pad: var(--space-4);
  --split-gap: var(--space-5);
  --split-rail-min: 14rem;
  --split-rail-max: 22rem;
  --split-rail-share: 25%;
  --z-pop: 3; /* popovers (home picker listbox) */
}
