/* ==========================================================================
   Labour Life practice system: tokens
   The app theme built from the Labour Life website palette (labour-life
   repo, assets/css/site.css): the day values first, and at the end of this
   file the night values (decision 494, html.is-dark). Rules that come with it:
   - Red is a fill with white text, or text on a light surface. On the coal
     top bar red text is --red-hi, never --red.
   - One red primary button per screen. Deleting is never a red fill.
   - Inputs are 16px (iOS zooms under that). Controls are at least 44px tall.
   - Colour is never the only signal: every badge carries a word.
   - Font weights: Barlow 400 500 600 700, Barlow Condensed 500 600 700 800.
     No italics, no in-between weights.
   - A colour is written here and nowhere else: the other stylesheets use the
     tokens, so night mode is this file's work. tests/146-dark-mode.test.php
     keeps the short list of what may still stand in another file.
   ========================================================================== */

@font-face { font-family: "Barlow"; src: url("../fonts/barlow-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/barlow-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/barlow-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/barlow-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("../fonts/barlow-condensed-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("../fonts/barlow-condensed-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("../fonts/barlow-condensed-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("../fonts/barlow-condensed-800.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: swap; }
/* Local fallbacks sized to match, so the swap to the web fonts barely moves the page. */
@font-face { font-family: "Barlow Condensed Fallback"; src: local("Arial Narrow"), local("ArialNarrow"), local("Roboto Condensed"), local("Arial"); size-adjust: 89%; ascent-override: 100%; descent-override: 26%; line-gap-override: 0%; }
@font-face { font-family: "Barlow Fallback"; src: local("Arial"), local("Helvetica"); size-adjust: 95%; ascent-override: 100%; descent-override: 20%; line-gap-override: 0%; }

/* The day values. In night mode three things keep them, as islands of day
   inside the dark Hub: the Google Drive tab and its sheet (Google's own light
   look, decision 195) and the box an email is written in (.rte__area: it is
   paper for real and is shown through a night glass, compose.css, so nothing
   of the night colours can ever go out with an email). Their selectors stand
   before :root, so the whole block is given to them again. */
html.is-dark .adm-gd, html.is-dark .adm-gd-sheet, html.is-dark .rte__area,
:root {
  color-scheme: light;

  /* brand: exact website values. The --ll- prefix keeps them apart from
     R5 One names that mean something else (--paper, --slate, --line). */
  --ll-coal: #0C0C0D;  --ll-coal-2: #171718;  --ll-coal-line: #2A2A2F;
  --ll-red: #C8191B;  --ll-red-hi: #EA5C5E;  --ll-oxblood: #6E0F10;
  --ll-mark-top: #D51A1A;  --ll-mark-bottom: #9E1915;
  --ll-paper: #EDEDEA;  --ll-paper-hi: #F6F6F3;  --ll-paper-line: #CFCFC9;
  --ll-ink: #141416;  --ll-ink-2: #4A4A52;  --ll-bone: #ECEAE6;  --ll-mist: #A09FA6;

  /* surfaces. Since 19 Nov 2026 (Jose: "The daymode is extremely bright ... incorporate the background
     like the below example with a greyish colour") the page is a light cool grey and the cards stay white
     with a thin edge and a soft shadow, so every card stands out (his mock-up). The ratios of words on
     the page are worked out by tests/js/day-contrast.mjs. */
  --bg: #E9ECF0;                       /* the page: white on it 1.19 */
  --surface: #FFFFFF;                  /* cards, tables, fields, side menu, modals */
  --sunken: var(--ll-paper);           /* table head, active menu item, wells */
  --tint: rgb(20 20 22 / .05);         /* hover on any light surface */
  --tint-2: rgb(20 20 22 / .09);       /* pressed, stronger hover */
  --scrim: rgb(12 12 13 / .5);         /* behind modals and the phone drawer */

  /* text */
  --ink: var(--ll-ink);                /* 18.40 on white, 15.53 on the page */
  --ink-soft: var(--ll-ink-2);         /* 8.78 on white, 7.41 on the page */
  --ink-mute: #66666E;                 /* 5.69 on white, 4.80 on the page: hints, meta, placeholders */
  --ink-disabled: #8A8990;             /* 3.46 on white, 2.92 on the page: disabled only */

  /* lines */
  --line: #DADDE3;                     /* hairlines, card borders (decorative): a cool grey since 19 Nov 2026, 1.15 on the page */
  --line-strong: var(--ll-paper-line); /* table head rule, dividers */
  --field-line: #85848B;               /* control borders: 3.70 on white, 3.13 on the page */
  --field-line-hover: var(--ll-ink-2);

  /* brand red */
  --red: var(--ll-red);                /* fill, or text on light */
  --red-hover: var(--ll-mark-bottom);
  --red-active: var(--ll-oxblood);
  --red-hi: var(--ll-red-hi);          /* red text on coal only */
  --red-ink: var(--ll-red);            /* red as words or a drawing on a surface (a lighter red at night): 4.91 on the page */
  --red-wash: #FBECEC;                 /* selected row, drop zone */
  --on-red: #FFFFFF;
  --link: var(--ll-red);
  --link-hover: var(--ll-mark-bottom);
  --band: linear-gradient(var(--ll-mark-top), var(--ll-mark-bottom));

  /* focus */
  --focus: var(--ll-ink);                      /* outline colour on light */
  --focus-ring: 0 0 0 3px rgb(20 20 22 / .18); /* box-shadow on focused fields */
  --focus-on-dark: var(--ll-red-hi);           /* outline colour in the top bar */

  /* states: solid (icons, dots, borders), ink (text), bg (wash), line (border on the wash) */
  --success: #2E7D4F;  --success-ink: #1E5E38;  --success-bg: #E8F4EC;  --success-line: #BFDDC9;
  --warning: #A86200;  --warning-ink: #7A4A00;  --warning-bg: #FFF4D6;  --warning-line: #EBD08A;
  --danger:  #C8191B;  --danger-ink:  #9E1915;  --danger-bg:  #FCEBEB;  --danger-line:  #F0BDBD;
  --info:    #2F6690;  --info-ink:    #1F4E79;  --info-bg:    #E9F1F8;  --info-line:    #BCD3E8;
  --neutral-ink: var(--ll-ink-2);  --neutral-bg: var(--ll-paper);  --neutral-line: var(--ll-paper-line);

  /* chrome: the coal top bar */
  --chrome-bg: var(--ll-coal);
  --chrome-bg-2: var(--ll-coal-2);     /* search field, hover */
  --chrome-line: var(--ll-coal-line);
  --chrome-text: var(--ll-bone);       /* 16.27 on coal */
  --chrome-soft: var(--ll-mist);       /* 7.45 on coal */
  --chrome-field-line: #77767D;        /* 4.35 on coal */
  --chrome-placeholder: #8A8990;       /* 5.17 on coal-2 */
  --chrome-hover: rgb(236 234 230 / .08);

  /* the phone drawer and bottom bar: light */
  --nav-bg: var(--surface);  --nav-line: var(--line);
  --nav-text: var(--ink-soft);  --nav-text-on: var(--ink);
  --nav-hover-bg: var(--tint);  --nav-on-bg: var(--sunken);

  /* the main menu on a computer: a black panel under the coal bar (Jose's
     mock-up of 25 Oct 2026). The open item is a --red pill with white words (5.9). */
  --rail-bg: var(--ll-coal);
  --rail-line: var(--ll-coal-line);
  --rail-text: var(--ll-bone);         /* 16.27 on coal */
  --rail-text-on: #FFFFFF;
  --rail-soft: var(--ll-mist);         /* icons: 7.45 on coal */
  --rail-hover: rgb(236 234 230 / .08);

  /* Home since 16 Nov 2026 like Jose's mock-up (decisions 500 to 503): the
     weather card on the band, and the red flow behind the whole page
     (core/flow-art.js, shell.css .pgflow). Night values below (html.is-dark). */
  --hero-glass: rgb(255 255 255 / .82);
  /* The flow is the same dark red by day as at night (Franro, 16 Nov 2026: "on light mode it can
     stay that dark red"): these are the colours the night values give over the night page, solid. */
  --flow-back: rgb(65 13 15 / .94);  --flow-mid: rgb(122 18 20 / .94);
  --flow-front: rgb(202 70 72 / .96);  --flow-line: rgb(234 92 94 / .7);
  /* the weather icon on the band (27 Oct 2026): drawn on the light band by day, the dark one at night */
  --wi-sun: #E9A100;  --wi-moon: #B9AF84;  --wi-cloud: #C4CBD4;  --wi-cloud-dark: #8C97A6;
  --wi-drop: rgb(52 120 186 / .9);  --wi-fog: rgb(90 98 110 / .7);  --wi-bolt: #E3A000;
  /* the New emails tile on Home: words 7.5 on its wash */
  --mail-bg: #F1ECFA;  --mail-ink: #5B3A9E;

  /* paper: what stays white at night too. A PDF page, a picture, a company's logo, the QR code. */
  --paper: #FFFFFF;
  /* a coal fill on a light surface (the initials of a person, a busy button) and what stands on it */
  --coal-fill: var(--ll-coal);  --on-coal-fill: var(--ll-bone);
  /* the toast: coal by day, a step up from the page at night. Its tick, its button and its cross
     stand on a dark fill by day and at night, so they never change. */
  --toast-bg: var(--ll-coal);  --toast-ink: var(--ll-bone);  --toast-soft: var(--ll-mist);
  --toast-ok: #BFDDC9;  --toast-act: var(--ll-red-hi);
  /* Claude in the Hub: the person's own message, a block of code, every second row of a table,
     the veil while files are dragged in, the hairline round the floating panel */
  --bubble-bg: var(--ll-coal-2);  --bubble-ink: var(--ll-bone);
  --code-bg: var(--ll-coal);  --code-ink: var(--ll-bone);
  --stripe: rgb(20 20 22 / .022);  --veil: rgb(255 255 255 / .88);  --edge: rgb(20 20 22 / .08);
  /* the small tile of a file's kind on Home: white letters on it, by day and at night */
  --file-other: var(--ll-ink-2);  --file-pdf: var(--ll-red);  --file-word: #2B579A;  --file-excel: #217346;
  --file-image: #1F4E79;  --on-file: #FFFFFF;
  /* the focus ring of the box an email is written in, at night (the box itself keeps the day values) */
  --night-focus-ring: 0 0 0 3px rgb(236 234 230 / .3);

  /* shape: xs badges and checkboxes (the website's radius), sm buttons and fields,
     md cards and tables, lg modals and popovers, pill avatars and count bubbles */
  --r-xs: 2px;  --r-sm: 4px;  --r-md: 6px;  --r-lg: 10px;  --r-pill: 999px;

  /* depth */
  --shadow-soft: 0 1px 2px rgb(16 24 40 / .06), 0 1px 3px rgb(16 24 40 / .05);   /* a card on the grey page (19 Nov 2026) */
  --shadow-lift: 0 1px 2px rgb(16 24 40 / .06), 0 8px 24px -10px rgb(16 24 40 / .16);
  --shadow-pop: 0 4px 12px rgb(20 20 22 / .08), 0 24px 56px -16px rgb(20 20 22 / .28);
  --shadow-drawer: 0 0 60px -10px rgb(20 20 22 / .3);

  /* type */
  --font-body: "Barlow", "Barlow Fallback", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Barlow Condensed", "Barlow Condensed Fallback", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  --font-mono: ui-monospace, Consolas, Menlo, monospace;
  --fs-label: .8125rem;   /* 13px: uppercase labels and badges only */
  --fs-sm: .875rem;       /* 14px: hints, meta, dense table cells */
  --fs-body: 1rem;        /* 16px */
  --fs-lg: 1.125rem;      /* 18px: lead text, list titles */
  --fs-h3: 1.25rem;       /* 20px */
  --fs-h2: 1.5rem;        /* 24px */
  --fs-h1: clamp(1.75rem, 1.45rem + 1.2vw, 2.25rem);   /* 28 to 36px */
  --fs-stat: clamp(2.25rem, 1.9rem + 1.5vw, 3rem);     /* home screen counts */
  --lh-tight: 1.1;  --lh-snug: 1.3;  --lh-body: 1.5;  --track-label: .08em;

  /* controls */
  --tap: 44px;            /* smallest touch target, both directions */
  --control-h: 44px;      /* buttons, fields, menu rows */
  --control-h-lg: 52px;   /* the main action on a phone, login fields */
  --control-h-sm: 36px;   /* dense desktop tools only; back to 44px under (pointer: coarse) */

  /* layout */
  --top-h: 56px;  --side-w: 208px;   /* the black main menu on a computer (Jose's mock-up of 25 Oct 2026) */
  --bottom-h: 60px;       /* phone bottom bar, add env(safe-area-inset-bottom) */
  --panel-w: min(640px, 100vw);  --content-max: 1200px;  --gutter: clamp(16px, 3vw, 32px);

  /* spacing (4px base) */
  --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem; --s5: 1.5rem; --s6: 2rem; --s7: 3rem; --s8: 4rem;

  /* motion */
  --ease-out: cubic-bezier(.2, .7, .1, 1);   /* the website's --ease */
  --dur-1: .16s; --dur-2: .24s; --dur-3: .4s;

  /* z ladder (nothing in between): sticky table heads, phone bottom bar, top bar,
     slide-over panel, scrim, side menu as a drawer, modal, menus and pickers, toast */
  --z-sticky: 5;  --z-bottom: 50;  --z-top: 60;  --z-panel: 80;  --z-scrim: 90;
  --z-side: 95;  --z-modal: 200;  --z-pop: 300;  --z-toast: 400;

  /* Google Drive (15 Oct 2026, late): Google's own look, used ONLY inside the
     Google Drive tab of Admin, Settings and its sheet (admin.css .adm-gd,
     .adm-gd-sheet). The rest of the app keeps the Labour Life red above.
     Text on a wash uses the darker -ink shade, so it stays at 4.5 or more. */
  --gd-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gd-ink: #202124;                   /* headings: 16.1 on white */
  --gd-ink-2: #5f6368;                 /* secondary text: 6.0 on white */
  --gd-ink-3: #3c4043;                 /* body text */
  --gd-line: #dadce0;                  /* card and button borders */
  --gd-field-line: #80868b;            /* text box borders: 3.68 on white (Google's outlined field) */
  --gd-wash: #f8f9fa;                  /* quiet panels */
  --gd-grey: #f1f3f4;                  /* the grey chip, hover */
  --gd-track: #e8eaed;                 /* the track of a bar */
  --gd-folder: #5f6368;                /* Drive's grey folder icons */
  --gd-blue: #1a73e8;  --gd-blue-hover: #1765cc;  --gd-blue-active: #185abc;  --gd-on-blue: #FFFFFF;   /* white on blue: 4.5 */
  --gd-blue-ink: #174ea6;  --gd-blue-wash: #e8f0fe;  --gd-blue-line: #d2e3fc;
  --gd-green: #188038;  --gd-green-ink: #137333;  --gd-green-wash: #e6f4ea;  --gd-green-line: #ceead6;
  --gd-amber: #b06000;  --gd-amber-ink: #8f4c00;  --gd-amber-wash: #fef7e0;  --gd-amber-line: #feefc3;  --gd-amber-bar: #f9ab00;
  --gd-red: #d93025;  --gd-red-ink: #c5221f;  --gd-red-wash: #fce8e6;  --gd-red-line: #fad2cf;
  --gd-r-card: 8px;  --gd-r-btn: 4px;
  --gd-shadow: 0 1px 2px rgb(60 64 67 / .3), 0 1px 3px 1px rgb(60 64 67 / .15);
}

@media (prefers-contrast: more) { :root { --ink-soft: #2A2A30; --ink-mute: #4A4A52; --line: #CFCFC9; --line-strong: #85848B; --field-line: #4A4A52; --gd-field-line: #4A4A52; } }

/* ==========================================================================
   Night mode (decision 494, Jose: "The whole HUB must have a night mode",
   "interchangeable between day/night mode which is set in the homescreen").

   One class on <html>, is-dark, set before the first paint by
   js/theme-early.js from the choice kept in the browser, and kept in step by
   js/core/theme.js (the button beside the bell: components/theme-switch.js).
   Day unless the person chose night: the computer's own setting is not
   followed.

   Nothing is restyled piece by piece. The tokens above get their night
   values here, so every card, table, field, menu, window and badge follows
   by itself. A token that :root builds from another one (--nav-*, --danger
   on a button) follows too, because these values stand on the same element.
   Jose's mock-up: the page near black, a card a step up with a thin line,
   words near white, the red of the mark unchanged as a fill.

   Worked out by tests/js/dark-contrast.mjs. On a card (#151518): --ink
   16.1, --ink-soft 11.0, --ink-mute 7.2, --link and --red-ink 6.8,
   --field-line 4.4 (an edge needs 3), --ink-disabled 3.9 (disabled only).
   On the page (#0B0B0D): --ink 17.4, --ink-mute 7.8. On a table head or a
   well (#232329): --ink-mute 6.2, --field-line 3.7. Each state's -ink on its
   -bg is 8 or more. White on --red stays 5.8: red is still a fill; as words
   or a drawing on a dark surface it is --red-ink.

   What stays as it is by day: the top bar and the black menu (coal already),
   the bands of Home and the weather, the Google Drive tab (an island of day,
   see :root), and paper: a PDF page, a picture, a company's logo, the QR
   code, and the box an email is written in (compose.css).

   Screen only: everything prints as ink on paper, as before.
   ========================================================================== */
@media screen {
  html.is-dark {
    color-scheme: dark;

    --bg: #0B0B0D;  --surface: #151518;  --sunken: #232329;
    --tint: rgb(236 234 230 / .06);  --tint-2: rgb(236 234 230 / .12);
    --scrim: rgb(0 0 0 / .68);

    --ink: #F2F1EE;  --ink-soft: #C9C8CE;  --ink-mute: #A3A2AA;  --ink-disabled: #74737B;

    --line: #2A2A30;  --line-strong: #3E3E46;
    --field-line: #7C7B84;  --field-line-hover: #C9C8CE;

    --red-wash: #33161A;  --red-ink: #F07A7C;
    --link: #F07A7C;  --link-hover: #F7A3A4;

    --focus: #F2F1EE;
    --focus-ring: 0 0 0 3px rgb(236 234 230 / .3);

    --success: #4CAF7A;  --success-ink: #8FD6AC;  --success-bg: #12291C;  --success-line: #245C3B;
    --warning: #D9A13A;  --warning-ink: #F0C875;  --warning-bg: #33270A;  --warning-line: #6B5216;
    --danger:  #E5484D;  --danger-ink:  #F5A3A4;  --danger-bg:  #361416;  --danger-line:  #6E2526;
    --info:    #5B9BD5;  --info-ink:    #A9CDEE;  --info-bg:    #12263A;  --info-line:    #264B6B;
    --neutral-ink: #C9C8CE;  --neutral-bg: #232329;  --neutral-line: #3E3E46;

    --mail-bg: #221A36;  --mail-ink: #C3A8F5;

    --hero-glass: rgb(21 21 24 / .78);
    --flow-back: rgb(110 15 16 / .55);  --flow-mid: rgb(200 25 27 / .45);
    --flow-front: rgb(234 92 94 / .70);  --flow-line: rgb(234 92 94 / .5);
    --wi-sun: #FFC94D;  --wi-moon: #F1EEDF;  --wi-cloud: #FFFFFF;  --wi-cloud-dark: #DCE4EE;
    --wi-drop: rgb(186 214 240 / .85);  --wi-fog: rgb(255 255 255 / .85);  --wi-bolt: #FFE08A;

    --coal-fill: #3A3A42;
    --toast-bg: #2C2C33;  --toast-act: #F28B8D;
    --bubble-bg: #2C2C33;  --code-bg: #1E1E23;
    --stripe: rgb(236 234 230 / .035);  --veil: rgb(11 11 13 / .86);  --edge: rgb(236 234 230 / .14);

    --shadow-soft: 0 1px 2px rgb(0 0 0 / .5);
    --shadow-lift: 0 1px 2px rgb(0 0 0 / .5), 0 8px 24px -10px rgb(0 0 0 / .7);
    --shadow-pop: 0 0 0 1px rgb(236 234 230 / .07), 0 4px 12px rgb(0 0 0 / .5), 0 24px 56px -16px rgb(0 0 0 / .8);
    --shadow-drawer: 0 0 60px -10px rgb(0 0 0 / .8);
  }
}
@media screen and (prefers-contrast: more) {
  html.is-dark { --ink-soft: #E0DFE4; --ink-mute: #C9C8CE; --line: #3E3E46; --line-strong: #7C7B84; --field-line: #C9C8CE; }
}
