/* The theme of the pages the cabinet leads to (the claim, the protocol, the sign-in) and of the
   windows of the shared scripts (a long operation, a dialog): the dark colours and the place of
   the button of the theme. site/assets/js/theme.js puts data-theme="dark" on <html> when the
   person chose it; without it the colours here do not apply.
   The colours of design system 11 are turned over: the ink becomes light, the white a dark
   surface, so what was dark on white becomes light on dark and the other way round. What stands
   on green keeps the dark ink. The sheet of a document stays white paper (sheet.css). */

:root[data-theme="dark"] {
  color-scheme: dark;
  --PRGRM_color-ink: #e8eaed;
  --PRGRM_color-charcoal: #c9cfd6;
  --PRGRM_color-muted: #959fab;
  --PRGRM_color-body: #b8c0c9;
  --PRGRM_color-line: #2e3339;
  --PRGRM_color-page: #121417;
  --PRGRM_color-white: #1a1d21;
  --PRGRM_color-green-dark: #3ddc8b;
  --PRGRM_color-green-soft: #173726;
  --PRGRM_color-card: #23272c;
  --PRGRM_color-card-green: #173726;
  --PRGRM_shadow-panel: 0 28px 72px rgba(0, 0, 0, .5);
  --PRGRM_shadow-button: none;
  /* The colours the shared styles write as they are, turned for the dark. */
  --zt-edge: #464d55;
  --zt-desk: #0d0f11;
  --zt-error: #ff7a70;
  --zt-on-green: #191b1e;
}

/* What stands on green keeps the dark ink: the green buttons and the hover of the others. */
:root[data-theme="dark"] .PRGRM_button,
:root[data-theme="dark"] .PRGRM_root a.PRGRM_button,
:root[data-theme="dark"] .PRGRM_button--outline:hover,
:root[data-theme="dark"] .z-fit button:hover:not([aria-pressed="true"]),
:root[data-theme="dark"] .z-round:hover,
:root[data-theme="dark"] .z-x:hover { color: var(--zt-on-green); }
:root[data-theme="dark"] .PRGRM_button--outline,
:root[data-theme="dark"] .PRGRM_root a.PRGRM_button--outline { color: var(--PRGRM_color-ink); }
:root[data-theme="dark"] .PRGRM_root a.PRGRM_button--outline:hover { color: var(--zt-on-green); }
:root[data-theme="dark"] .PRGRM_button--dark,
:root[data-theme="dark"] .PRGRM_root a.PRGRM_button--dark { color: var(--PRGRM_color-white); }

/* The frames the shared styles draw in a light grey. */
:root[data-theme="dark"] .z-input,
:root[data-theme="dark"] .z-area,
:root[data-theme="dark"] .z-check-input,
:root[data-theme="dark"] .z-date,
:root[data-theme="dark"] .z-cal,
:root[data-theme="dark"] .z-cal-nav:hover,
:root[data-theme="dark"] .z-cal-day:hover,
:root[data-theme="dark"] .z-doc-item,
:root[data-theme="dark"] .z-doc-paper,
:root[data-theme="dark"] .z-fit,
:root[data-theme="dark"] .z-x,
:root[data-theme="dark"] .z-topics label,
:root[data-theme="dark"] .z-seg,
:root[data-theme="dark"] .z-drop,
:root[data-theme="dark"] .z-result { border-color: var(--zt-edge); }
:root[data-theme="dark"] .z-doc-item:hover,
:root[data-theme="dark"] .z-doc-paper:hover,
:root[data-theme="dark"] .z-topics label:hover { border-color: var(--PRGRM_color-ink); }

/* The button of the theme on the claim page stays in the top right corner even when a long status
   carries the other buttons to the next line. The room for it is kept only where the page has it. */
.z-claim-top:has([data-theme-slot], .zv-theme) { padding-right: 96px; }
.z-claim-top .zv-theme { position: absolute; top: 12px; right: 24px; }

/* Where «Войти» stands at the top (the privacy policy), the button of the theme comes right after it, at its
   height; a phone has no room for both, and «Войти» stays. */
.z-top:has([data-theme-slot], .zv-theme) .z-signin { margin-left: auto; }
.z-top .z-signin + .zv-theme { width: 44px; height: 44px; }
@media (max-width: 760px) { .z-top .z-signin + .zv-theme { display: none; } }

/* The logo is drawn in the ink of the light theme: in the dark it turns light. */
:root[data-theme="dark"] .z-logo img { filter: invert(1); }

/* Under the document of the protocol, and the errors. */
:root[data-theme="dark"] .z-doc-main { background: var(--zt-desk); }
:root[data-theme="dark"] .PRGRM_root .z-error { color: var(--zt-error); }

/* «Зафиксировано.ру»: the pages of its own. */
/* The cabinet: the button stands with the address and «Выйти». The menu of the address gets a frame on the dark. */
.z-user .zv-theme { width: 44px; height: 44px; }
:root[data-theme="dark"] .z-me-pop { border: 1px solid var(--zt-edge); }
/* The admin panel: the button closes the top bar. */
.zad-top .zv-theme { width: 44px; height: 44px; }
/* «Новый протокол» of the cabinet stands on the colour of the page, not on green: light ink on the
   dark, the dark ink again when the hover fills it with green. */
:root[data-theme="dark"] .z-btn-new { color: var(--PRGRM_color-ink); }
:root[data-theme="dark"] .z-btn-new:hover { color: var(--zt-on-green); }
