/* V41: two dark themes in the tone of the live background, «Сумерки» (dusk) and «Розовое дерево» (rose).
   The shared block has no surface colours; each variant block holds its own palette.
   Rules that need a colour other than the shared variables are written once, through the variant's variables. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --shell: var(--page);
  --warning: #EED0A0; --error: #FFC6B6;
  --stop-fill: #F29A86; --stop-text: #4D251C;
  --waveform-edge: #B8C79C; --waveform-peach: #E7B599; --waveform-coral: #FFA892;
  /* V35 fix: the button on an operation card of «Управление» on a narrow screen. */
  --admin-card-button: var(--page);
}

/* «Сумерки» */
:root[data-theme="dark"][data-dark="dusk"] {
  --page: #202732; --surface: #2F3846; --field: #29303E; --panel-fill: #29303E;
  --ink: #EFF2F8; --muted: #B8C3D2;
  --accent: #C7D9E8; --focus: #C7D9E8; --success: #C7D9E8;
  --button-fill: #333D4C; --button-hover: #3E4A5C;
  --primary-fill: #C7D9E8; --primary-hover: #DCE8F2; --primary-text: #253747;
  --active: #435269; --nav-active: #435269;
  --warning-bg: #3D3A33; --error-bg: #48303A;
  --shadow: 0 12px 32px #0A0D1270;
  --process-text: #CEDFEE; --process-fill: #344454; --process-edge: #849EB5; --process-hover: #3C4E62;
  --menu-fill: #364254;
  --on-scene-caption: #D6DDE8;
  --toggle-a: rgba(54,61,78,.92); --toggle-b: rgba(48,55,70,.9);
  --main-0: #DCE8F2; --main-1: #C7D9E8; --main-2: #B3C9DC; --main-glow: 180, 203, 224;
  --ambient-base: #202732;
}
:root[data-theme="dark"][data-dark="dusk"].editor-open { --ink: #EFF2F8; --muted: #B8C3D2; --active: #435269; }
:root[data-theme="dark"][data-dark="dusk"] .style-list { --style-hover: #313A4A; --style-divider: #3E4858; --style-scroll: #56617A; }

/* «Розовое дерево» */
:root[data-theme="dark"][data-dark="rose"] {
  --page: #2A2428; --surface: #382F34; --field: #322B2F; --panel-fill: #322B2F;
  --ink: #F3EDF0; --muted: #CBBCC3;
  --accent: #E4CBC9; --focus: #E4CBC9; --success: #E4CBC9;
  --button-fill: #3D3339; --button-hover: #4A3F46;
  --primary-fill: #E4CBC9; --primary-hover: #EFDDDC; --primary-text: #49323A;
  --active: #53434D; --nav-active: #53434D;
  --warning-bg: #463A2E; --error-bg: #52302F;
  --shadow: 0 12px 32px #120C0E70;
  --process-text: #E8D0D5; --process-fill: #493940; --process-edge: #A58B97; --process-hover: #54424A;
  --menu-fill: #44383F;
  --on-scene-caption: #E2D8DB;
  --toggle-a: rgba(62,52,57,.92); --toggle-b: rgba(56,47,52,.9);
  --main-0: #EFDDDC; --main-1: #E4CBC9; --main-2: #D6B6B8; --main-glow: 228, 203, 201;
  --ambient-base: #2A2428;
}
:root[data-theme="dark"][data-dark="rose"].editor-open { --ink: #F3EDF0; --muted: #CBBCC3; --active: #53434D; }
:root[data-theme="dark"][data-dark="rose"] .style-list { --style-hover: #3B3236; --style-divider: #4A3F44; --style-scroll: #625459; }

/* Menus and dialogs are lighter than the cards. */
:root[data-theme="dark"] :is(#workspace-nav, .popover, .select-list, #app-dialog) { background: var(--menu-fill); }
/* The chosen tab («Текст» / «Результат») is clearly lighter than its neighbour. */
:root[data-theme="dark"] .editor-tabs button[aria-selected="true"] { background: var(--active); }
/* «Отмена» in a dialog is lighter than the dialog, not a hole in it. */
:root[data-theme="dark"] #app-dialog button:not(.primary) { background: var(--active); }
/* The dimmed layer under the style list and a dialog takes the page colour of the variant
   (the shared light rule in app.css dims with the old brown page colour). */
:root[data-theme="dark"] .style-backdrop, :root[data-theme="dark"] #app-dialog::backdrop { background: color-mix(in srgb, var(--page) 40%, transparent); }

/* V27: quiet labels that sit directly on the live background keep 4.5:1 over its light wave edges. */
:root[data-theme="dark"].editor-open :is(.privacy-details summary, .style-line-caption) { color: var(--on-scene-caption); text-shadow: 0 0 3px var(--page), 0 0 8px var(--page); }

:root[data-theme="dark"] #back-notice { background: rgba(242, 238, 232, 0.72); color: #202732; }
:root[data-theme="dark"][data-dark="rose"] #back-notice { color: #2A2428; }
:root[data-theme="dark"] #google-native { background: #131314; border-color: #8E918F; color: #E3E3E3; }
