/* Modern UI tokens (see docs/modern-ui-plan.md). Shared by every Modern page; page rules live in
   their own files and are scoped under the page's root class. State is shown with an even 1px
   border, a tint, a dot or a text label: never a colored side bar. */
:root {
    --m-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif;

    /* Text. The greys are neutral (equal red, green and blue): the slate ones read as green-gray to the
       office. Muted text (--m-text-3) keeps 4.5:1 on --m-bg-sunken and --m-bg-canvas; --m-text-4 is for marks
       inside a card, not words, and falls under 3:1 on the canvas. */
    --m-text: #16191d;
    --m-text-2: #4a4a4a;
    --m-text-3: #636363;
    --m-text-4: #949494;
    --m-text-inverse: #ffffff;

    /* Surfaces and lines */
    --m-bg: #ffffff;
    --m-bg-page: #f7f7f7;
    --m-bg-sunken: #f2f2f2;
    --m-bg-hover: #f9f9f9;
    /* The page ground under the white cards, darker than every well, so a card reads as a card. */
    --m-bg-canvas: #eeeeee;
    /* The lines show on every tint they divide (--m-line is 1.33:1 on --m-bg-hover); the heavier ones stay heavier. */
    --m-line: #dadada;
    --m-line-2: #cfcfcf;
    --m-line-strong: #c2c2c2;

    /* Accent */
    --m-accent: #2456d6;
    --m-accent-strong: #1c46ad;
    --m-accent-tint: #e6edff;
    --m-accent-line: #9db6ee;

    /* Status */
    --m-success: #067647;
    --m-success-dot: #079455;
    --m-success-tint: #e3f5ea;
    --m-success-line: #86cfa3;
    --m-warning: #a83f06;
    --m-warning-dot: #dc6803;
    --m-warning-tint: #fff1d1;
    --m-warning-line: #f5c26b;
    /* The pale orange behind the board's attention glyph, kept from before the warning tint deepened. */
    --m-warning-wash: #fff3e0;
    --m-danger: #b42318;
    --m-danger-dot: #d92d20;
    --m-danger-tint: #fde9e7;
    --m-danger-line: #f0a198;
    --m-now: #d92d20;
    --m-neutral-dot: #7a7a7a;

    /* Company fills: color-fill.js and ColorFill.cs set --m-fill and --m-on-fill per element. A fill with
       no color of its own is --m-fill-none, under --m-text-inverse. */
    --m-fill-edge: rgba(0, 0, 0, 0.14);
    --m-fill-none: #4a4a4a;

    /* Today and selection (board, My Schedule) */
    --m-today: #f5f8ff;
    --m-today-line: #d6e2fb;
    --m-select: rgba(36, 86, 214, 0.25);
    --m-focus-strong: 0 0 0 4px rgba(36, 86, 214, 0.35);

    /* Section hues (Wayfinding): a 28px tile with a white glyph, each 4.5:1 or more under --m-on-hue and 3:1
       or more on --m-bg, --m-bg-page, --m-bg-sunken and --m-bg-canvas. Hue groups the sections; the glyph names them. */
    --m-hue-cyan: #0e7490;
    --m-hue-purple: #7e22ce;
    --m-hue-magenta: #b4236f;
    --m-hue-graphite: #545454;
    --m-on-hue: #ffffff;
    /* Identity colors: a staff member's circle, from IdentityHue (1 to 7, PDD/BusinessLogic/Ui/IdentityHue.cs).
       Each is 4.5:1 or more under --m-on-hue and 3:1 or more on --m-bg and --m-bg-page. The count is fixed at 7:
       changing it recolors everyone. */
    --m-id-1: #934951;
    --m-id-2: #895618;
    --m-id-3: #746208;
    --m-id-4: #596c24;
    --m-id-5: #00756c;
    --m-id-6: #615999;
    --m-id-7: #834d7e;
    --m-sec-words: var(--m-hue-purple);     /* Scope of work, Job Notes, Calls */
    --m-sec-things: var(--m-hue-cyan);      /* Items, Pending, Wish list, Equipment, Purchase orders */
    --m-sec-media: var(--m-hue-magenta);    /* Photos, Attachments, Signature */
    --m-sec-records: var(--m-hue-graphite); /* Team, Visits, Billing, Cost, Activity log */
    --m-tile: 28px;
    --m-tile-radius: 8px;
    /* The height of the section-color cap across the top of the job page's side panel cards (1024px and up). */
    --m-cap-h: 6px;

    /* Elevation and overlays */
    --m-scrim: rgba(13, 13, 18, 0.4);
    --m-shadow-up: 0 -4px 16px rgba(0, 0, 0, 0.08);
    --m-shadow-lift: 0 8px 20px rgba(0, 0, 0, 0.18);

    /* The chrome: one ink behind every dark surface (the Modern navbar, a pressed chip, the selected day, toasts and
       tips, the desktop job header). Words on it are --m-text-inverse or --m-on-chrome-2, 4.5:1 or more, and so are
       the link and the error; the live dot and the edge are 3:1 or more. The hover keeps the words at 4.5:1. */
    --m-chrome: #14213d;
    --m-on-chrome-2: #bdc1c9;
    --m-on-chrome-live: #47cd89; /* the live dot on My Schedule's on-site band */
    --m-on-chrome-edge: #a1a6b1; /* the desktop job header's pill edges and outline buttons */
    --m-on-chrome-link: #a9c1ff; /* Reopen on the desktop job header */
    --m-on-chrome-danger: #ffb4ab; /* the job title's error on the desktop job header */
    --m-chrome-hover: #2c3a5c; /* a hovered More, Add, pencil or Reopen on the desktop job header */

    /* On the dark navbar, and on photos */
    --m-on-dark-fill: rgba(255, 255, 255, 0.12);
    --m-on-dark-fill-hover: rgba(255, 255, 255, 0.14);
    --m-on-dark-line: rgba(255, 255, 255, 0.35);
    --m-on-dark-text-2: rgba(255, 255, 255, 0.8);
    --m-on-photo: rgba(255, 255, 255, 0.94);
    --m-on-photo-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);

    /* Board and My Schedule inks and washes, kept as they were drawn */
    --m-title: #0d0d12;
    --m-ink: #3d3d3d;
    --m-bg-seg: #efefef;
    /* A segmented control's track on the canvas, where --m-bg-sunken would not show. */
    --m-seg-track: #e2e2e2;
    --m-hover-wash: rgba(0, 0, 0, 0.05);
    /* A printed card edge */
    --m-line-print: #cccccc;

    /* Shape */
    --m-radius-sm: 8px;
    --m-radius: 10px;
    --m-radius-lg: 14px;
    --m-radius-xl: 20px;
    --m-radius-pill: 999px;
    --m-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
    --m-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    --m-shadow-lg: 0 12px 24px -6px rgba(0, 0, 0, 0.14), 0 4px 8px -4px rgba(0, 0, 0, 0.06);
    --m-focus: 0 0 0 3px rgba(36, 86, 214, 0.28);
    /* Selection: a lifted card, the same in a lighter wash, and the rings on a selected row or visit. */
    --m-shadow-select: 0 4px 12px var(--m-select);
    --m-shadow-pick: 0 4px 12px rgba(36, 86, 214, 0.16);
    --m-ring-select: 0 0 0 5px rgba(36, 86, 214, 0.28);
    --m-ring-onsite: 0 0 0 5px rgba(36, 86, 214, 0.35);
    /* Cards and floating things, by what they lift */
    --m-shadow-card: 0 1px 2px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.06);
    --m-shadow-hero: 0 4px 12px rgba(0, 0, 0, 0.06);
    --m-shadow-seg: 0 1px 3px rgba(0, 0, 0, 0.12);
    --m-shadow-float: 0 4px 16px rgba(0, 0, 0, 0.12);
    --m-shadow-drawer: -8px 0 24px rgba(0, 0, 0, 0.18);
    --m-shadow-drag: 0 10px 28px rgba(0, 0, 0, 0.18);
    --m-shadow-preview: 0 8px 28px rgba(0, 0, 0, 0.22);
    --m-shadow-tip: 0 2px 8px rgba(0, 0, 0, 0.24);
    --m-shadow-chip: 0 1px 4px rgba(0, 0, 0, 0.3);
    --m-shadow-chip-lift: 0 2px 10px rgba(0, 0, 0, 0.38);
    /* The one select chevron (the native arrow sits against the edge on iOS), in --m-text-2. */
    --m-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%234a4a4a' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");

    /* Size */
    --m-touch: 44px;
    --m-gutter: 16px;
    --m-fs-xs: 12px;
    --m-fs-sm: 14px;
    --m-fs: 16px;
    --m-fs-lg: 18px;
    --m-fs-xl: 22px;
    --m-fs-2xl: 28px;
}
