/* «Муҳр» tokens: the workspace palette, light and dark.

   Loaded after tokens.css, which keeps the platform's original values as a
   frozen contract; everything the workspace draws reads the names below.
   --sunk, --hover and --sel keep their old names with new values.

   Three blocks for dark: an explicit choice (data-theme=dark on <html>, set by
   the server from the user's preference) and «как в системе» (no attribute,
   the operating system asks for dark). The two bodies are identical — a test
   holds them so — because CSS has no way to share a block between a selector
   and a media query. */

:root{
  color-scheme:light;
  --bg:#F4F3EF; --surface:#FFFFFF; --raised:#FFFFFF; --sunk:#ECEAE4; --hover:#E7E5DE; --sel:#E6ECF7;
  --ink:#141A24; --ink-2:#475161; --ink-3:#5E6776; --ink-4:#9AA1AD;
  --rule:#E2DFD7; --rule-2:#CBC7BC; --rule-strong:#141A24;
  --primary:#1E4B9E; --primary-hover:#183E85; --primary-press:#13336E; --primary-soft:#E6ECF7;
  --primary-line:#A9BCE0; --on-primary:#FFFFFF;
  --ok:#1B6E42; --ok-bg:#E5F2EA; --warn:#8A5A00; --warn-bg:#FBF0D9; --warn-line:#E2C27A;
  --danger:#B42318; --danger-bg:#FCEBE9; --danger-line:#F2B8B2; --on-danger:#FFFFFF; --info:#0E6E79; --info-bg:#E2F2F3; --info-line:#9CCED3;
  --reject:#9F1D4A; --reject-bg:#FBE8EF; --draft:#4B5563; --draft-bg:#EEF0F2;
  --seal:#1E4B9E; --seal-ink:rgba(30,75,158,.86);
  --shadow:rgba(20,26,36,.18); --mark:#FBEEC0;
  --sh-1:0 1px 0 rgba(20,26,36,.06); --sh-2:0 2px 8px rgba(20,26,36,.08),0 1px 2px rgba(20,26,36,.06);
  --sh-3:0 18px 48px rgba(20,26,36,.18); --scrim:rgba(11,16,22,.44);
  --focus:0 0 0 2px #FFFFFF,0 0 0 4px #1E4B9E;
  --type-jr:#1E4B9E; --type-sp:#6B3FA0; --type-ot:#0E6E79; --type-zd:#8A5A00; --type-ns:#475161;

  /* The accent is the workspace's own colour: fed from the seven --brand*
     variables the branding block overrides, so a branded workspace's accent
     wins without anything here knowing about it. Yellow is a fill, never text
     on a light surface. */
  --accent:var(--brand); --on-accent:var(--brand-ink); --accent-soft:var(--brand-soft);
  --accent-line:var(--brand-line); --accent-deep:var(--brand-deep);
}

:root[data-theme=dark]{
  color-scheme:dark;
  --bg:#0F141B; --surface:#161C25; --raised:#1C2430; --sunk:#0B1016; --hover:#212A37; --sel:#1A2A47;
  --ink:#E8EBF0; --ink-2:#AEB6C2; --ink-3:#8A93A1; --ink-4:#5B6574;
  --rule:#263040; --rule-2:#344052; --rule-strong:#E8EBF0;
  --primary:#7FA6F0; --primary-hover:#98B8F4; --primary-press:#6690E0; --primary-soft:#1A2A47;
  --primary-line:#2F4A7A; --on-primary:#0B1424;
  --ok:#5BC48A; --ok-bg:#12291D; --warn:#E8B04A; --warn-bg:#2E2410; --warn-line:#5A4618;
  --danger:#F07A6E; --danger-bg:#331614; --danger-line:#5C2420; --on-danger:#1A0806; --info:#4FC1CB; --info-bg:#0F2A2E; --info-line:#1F4A50;
  --reject:#F28AB0; --reject-bg:#33162A; --draft:#AEB6C2; --draft-bg:#232B36;
  --seal:#8FB2F2; --seal-ink:rgba(143,178,242,.86);
  --shadow:rgba(0,0,0,.5); --mark:#4A3D10;
  --sh-1:0 1px 0 rgba(0,0,0,.4); --sh-2:0 2px 10px rgba(0,0,0,.45);
  --sh-3:0 18px 48px rgba(0,0,0,.6); --scrim:rgba(0,0,0,.6);
  --focus:0 0 0 2px #0F141B,0 0 0 4px #7FA6F0;
  --type-jr:#7FA6F0; --type-sp:#B79CF0; --type-ot:#4FC1CB; --type-zd:#E8B04A; --type-ns:#AEB6C2;
  --accent-soft:color-mix(in srgb,var(--brand) 16%,#161C25);
  --accent-deep:color-mix(in srgb,var(--brand) 45%,#FFFFFF);
  --accent-line:color-mix(in srgb,var(--brand) 55%,#161C25);
}

@media (prefers-color-scheme:dark){
  :root:not([data-theme]){
    color-scheme:dark;
    --bg:#0F141B; --surface:#161C25; --raised:#1C2430; --sunk:#0B1016; --hover:#212A37; --sel:#1A2A47;
    --ink:#E8EBF0; --ink-2:#AEB6C2; --ink-3:#8A93A1; --ink-4:#5B6574;
    --rule:#263040; --rule-2:#344052; --rule-strong:#E8EBF0;
    --primary:#7FA6F0; --primary-hover:#98B8F4; --primary-press:#6690E0; --primary-soft:#1A2A47;
    --primary-line:#2F4A7A; --on-primary:#0B1424;
    --ok:#5BC48A; --ok-bg:#12291D; --warn:#E8B04A; --warn-bg:#2E2410; --warn-line:#5A4618;
    --danger:#F07A6E; --danger-bg:#331614; --danger-line:#5C2420; --on-danger:#1A0806; --info:#4FC1CB; --info-bg:#0F2A2E; --info-line:#1F4A50;
    --reject:#F28AB0; --reject-bg:#33162A; --draft:#AEB6C2; --draft-bg:#232B36;
    --seal:#8FB2F2; --seal-ink:rgba(143,178,242,.86);
    --shadow:rgba(0,0,0,.5); --mark:#4A3D10;
    --sh-1:0 1px 0 rgba(0,0,0,.4); --sh-2:0 2px 10px rgba(0,0,0,.45);
    --sh-3:0 18px 48px rgba(0,0,0,.6); --scrim:rgba(0,0,0,.6);
    --focus:0 0 0 2px #0F141B,0 0 0 4px #7FA6F0;
    --type-jr:#7FA6F0; --type-sp:#B79CF0; --type-ot:#4FC1CB; --type-zd:#E8B04A; --type-ns:#AEB6C2;
    --accent-soft:color-mix(in srgb,var(--brand) 16%,#161C25);
    --accent-deep:color-mix(in srgb,var(--brand) 45%,#FFFFFF);
  --accent-line:color-mix(in srgb,var(--brand) 55%,#161C25);
  }
}
