/* =====================================================================================================================
   YUDEER «مسار» — TOKENS for the real product's vanilla interface (TASK-007 «MASAR M0/M1», agent A).
   Source: the approved prototype (MASAR.UX.1 identity/masar-tokens.css), every value checked against the live Masar
   section on main (pm-app/src/ui/css/tokens.css). Where the two differed, the LIVE value is used:
     --y-head            prototype 3.25rem → live 2.5rem
     --y-c-money-unit    live only → added (var(--y-c-text-2), «ر.س» ink of the live section)
     --y-toast-h         live only → added (0px; the live section measures it at run time)
     --y-z-tools         live only → added (45)
   Kept from the prototype because the live file has no such name (additions, not changed values):
     --y-num (the literal of live money.css) · --y-dialog (42rem, live .op-modal) · --y-content (76rem)
     --y-c-money-in / --y-c-money-out («مقترح» in the prototype; always with their word)
   Token names are the live names (--y-<group>-<role>[-<variant>]) so a value can be traced 1:1 to the product.

   SCOPING (binding for every masar/*.css file):
   - Declared ONLY on html[data-masar="on"] (never bare :root), so a page without the switch gets no token at all.
   - Inside @media screen: print is never affected (print.css and the legacy print paths stay exactly as they are).
   - No @font-face and no font file here: the product already loads pm/pm-fonts.css on every page, which defines
     'Vazirmatn', 'Alexandria' and their sized fallbacks 'Vazirmatn Fallback' / 'Alexandria Fallback'.
   - Light only (OD-PM-012). No dark scheme is declared on purpose.

   Breakpoints (media queries cannot read variables — the same numbers are written in masar-components.css):
     narrowest phone  ≤ 22.49em  (≤ 360 px)   page titles step down a size
     phone            < 47.5em   (< 760 px)   dialogs and panels full screen, tables stack
     tablet           ≥ 47.5em   (≥ 760 px)
     panel beside     ≥ 64em     (≥ 1024 px)  an operation panel sits beside the page
     wide             ≥ 80em     (≥ 1280 px)
     short screens    max-height 30em / 50em  pinned parts stop sticking / compact confirm bar
   ===================================================================================================================== */

@media screen {
  html[data-masar="on"] {
    /* ---- Surfaces: a paper-white page; white only for what floats; warm paper only for documents (receipt, statement) ---- */
    --y-c-canvas: #fbfcfb;      /* the page itself */
    --y-c-surface: #ffffff;     /* panels, menus, toasts, fields */
    --y-c-surface-2: #eef3f1;   /* wells: disabled fields, skeleton trays */
    --y-c-surface-3: #dfe8e5;   /* skeleton bars, the empty part of a meter */
    --y-c-paper: #fffdf8;       /* a document (receipt, statement): a document, not a card */
    --y-c-paper-line: #e6dfcf;
    --y-c-scrim: rgb(251 252 251 / 0.82); /* light veil behind a dialog; never dark */

    /* ---- Brand structure: tints of the logo's pine. Surfaces and strokes only — never text, never an action ---- */
    --y-c-pine-50: #f3f8f6;     /* row hover, quiet bands, confirm bar — text-3 on it 5.29 */
    --y-c-pine-100: #e6efec;    /* bands, dialog heads — text 11.77 · text-2 6.50 · text-3 4.84 */
    --y-c-pine-200: #d2e2dd;    /* pending part of a path / step bar — text-2 on it 5.68 */
    --y-c-pine-300: #a9c6be;    /* ledge lower level, chip edges, empty-state dashes */
    --y-c-pine-500: #6f9a91;    /* the ledge, done steps — 3.13 on surface (graphic only) */
    --y-c-ledge: var(--y-c-pine-500);

    /* ---- Lines ---- */
    --y-c-line: #dce5e2;          /* hairlines between rows; never the only edge of a control */
    --y-c-line-control: #788783;  /* field and secondary-button edges — 3.76 surface · 3.65 canvas · 3.35 surface-2 · 3.21 pine-100 */

    /* ---- Text: a green-leaning charcoal, never black (OD-PM-015) ---- */
    --y-c-text: #20302d;          /* 13.80 surface · 13.42 canvas · 13.57 paper · 11.77 pine-100 */
    --y-c-text-2: #475754;        /*  7.61 surface ·  6.50 pine-100 · 6.34 action-wash · 5.68 pine-200 */
    --y-c-text-3: #5b6a67;        /*  5.67 surface ·  5.52 canvas ·  5.06 surface-2 · 4.84 pine-100 */
    --y-c-text-on-action: #ffffff;
    --y-c-text-disabled: #7c8a87; /* disabled only (exempt from 1.4.3), always with a written reason nearby */

    /* ---- Action: the logo's color (OD-PM-015) — buttons, links, selected and focused things, nothing else ---- */
    --y-c-action: #0f3c3d;        /* 12.11 surface · 11.78 canvas · 10.34 pine-100; white on it 12.11 */
    --y-c-action-hover: #17504f;  /* white on it 9.14 */
    --y-c-action-press: #0a2c2d;  /* white on it 14.88 */
    --y-c-action-wash: #e1edea;   /* selected background — action on it 10.09 */
    --y-c-action-wash-2: #cde1dc; /* selected edge, text selection */
    --y-c-focus: #0f3c3d;         /* 2px ring + 2px gap: ≥ 10.09 on every surface */

    /* ---- States. The bare name is text (≥ 4.5 on surface and on its wash), -mark is graphic only (≥ 3 on surface),
            -wash is a quiet fill, -line its edge. Color never works alone: every state has its word and its icon. ---- */
    --y-c-ok: #1c6a4d;      --y-c-ok-mark: #2a8564;   --y-c-ok-wash: #e2f1ea;   --y-c-ok-line: #a9d3c1;   /* مسدَّد، مكتمل */
    --y-c-warn: #7a5300;    --y-c-warn-mark: #a8720c; --y-c-warn-wash: #fbefd6; --y-c-warn-line: #e6c98c; /* جزئي، تنبيه */
    --y-c-due: #a0372a;     --y-c-due-mark: #c65440;  --y-c-due-wash: #fae7e2;  --y-c-due-line: #edb9ae;  /* مستحق، مانع، خطأ */
    --y-c-info: #46566a;    --y-c-info-mark: #6a7a8c; --y-c-info-wash: #eaeef2; --y-c-info-line: #c5ced8; /* معلومة */
    --y-c-neutral: #475754; --y-c-neutral-wash: #edf1f0; --y-c-neutral-mark: #838f8c;
    --y-c-danger: #a0372a;  --y-c-danger-hover: #8a2c21; /* destructive confirm: white on it 6.83 / 8.53 */

    /* ---- Money ---- */
    --y-c-money: var(--y-c-text);
    --y-c-money-unit: var(--y-c-text-2); /* live: the currency word's ink where a unit is printed; halalas keep the figure's ink */
    --y-c-money-neg: var(--y-c-due);     /* always with its minus sign */
    --y-c-money-in: var(--y-c-ok);       /* «مقترح» (prototype): incoming money; always with its word («مستلم») */
    --y-c-money-out: var(--y-c-text);    /* «مقترح» (prototype): outgoing stays charcoal; its word says the direction */

    /* ---- Type: Vazirmatn for every word and figure; Alexandria (600) for page titles only (OD-PM-018 §2).
            The faces come from pm/pm-fonts.css (already loaded by the product); each stack starts with its sized fallback. ---- */
    --y-font-ui: 'Vazirmatn', 'Vazirmatn Fallback', 'Segoe UI', Tahoma, 'Noto Sans Arabic', sans-serif;
    --y-font-display: 'Alexandria', 'Alexandria Fallback', 'Vazirmatn', 'Segoe UI', Tahoma, 'Noto Sans Arabic', sans-serif;
    --y-fs-xs: 0.8125rem;  /* 13 — the floor for any product text: tags, counts */
    --y-fs-sm: 0.875rem;   /* 14 — meta lines, labels, hints */
    --y-fs-md: 0.9375rem;  /* 15 — dense body, buttons */
    --y-fs-base: 1rem;     /* 16 — body, fields */
    --y-fs-lg: 1.1875rem;  /* 19 — section titles (UI face, bold) */
    --y-fs-xl: 1.375rem;   /* 22 — page title on phones */
    --y-fs-2xl: 2rem;      /* 32 — page title from 47.5em */
    --y-lh-tight: 1.3;
    --y-lh-snug: 1.5;
    --y-lh-body: 1.7;
    --y-fw-regular: 400;
    --y-fw-medium: 500;
    --y-fw-semibold: 600;
    --y-fw-bold: 700;
    --y-num: lining-nums tabular-nums; /* figures in money, tables, counts (the literal of live money.css) */
    --y-money-sm: 0.9375rem; /* 15 */
    --y-money-md: 1.0625rem; /* 17 */
    --y-money-lg: 1.375rem;  /* 22 */
    --y-money-xl: 1.875rem;  /* 30 */
    --y-prose: 32em;         /* a prose line stays under ~80 characters */

    /* ---- Space (4/8) ---- */
    --y-sp-1: 0.25rem; --y-sp-2: 0.5rem; --y-sp-3: 0.75rem; --y-sp-4: 1rem; --y-sp-5: 1.25rem;
    --y-sp-6: 1.5rem;  --y-sp-8: 2rem;   --y-sp-10: 2.5rem; --y-sp-12: 3rem;

    /* ---- Radius: crisp. Rows and ledges square; controls round a little; documents barely ---- */
    --y-r-xs: 3px; --y-r-sm: 5px; --y-r-md: 9px; --y-r-lg: 12px; --y-r-xl: 18px; --y-r-full: 999px;
    --y-slant: 0.5rem; /* horizontal run of the logo's step on a tag end */

    /* ---- The ledge (الدرجة): the logo's stroke at page scale — a level stroke that falls 42° from the start side ---- */
    --y-ledge-t: 6px;      --y-ledge-rise: 12px;
    --y-ledge-t-sm: 4px;   --y-ledge-rise-sm: 8px;
    --y-run: 1.1106;       /* horizontal run per unit of rise at 42° (1/tan 42°) */

    /* ---- Borders and the one stroke width of every line icon ---- */
    --y-bw: 1px; --y-bw-strong: 1.5px; --y-bw-focus: 2px;
    --y-icon-stroke: 1.75;

    /* ---- Elevation: pine-tinted and rare — pages have no resting cards. 1 a document, 2 floats, 3 overlays ---- */
    --y-sh-1: 0 1px 2px rgb(15 60 61 / 0.07), 0 2px 6px -2px rgb(15 60 61 / 0.06);
    --y-sh-2: 0 8px 20px -8px rgb(15 60 61 / 0.22), 0 2px 4px rgb(15 60 61 / 0.05);
    --y-sh-3: 0 20px 48px -12px rgb(15 60 61 / 0.3), 0 4px 10px rgb(15 60 61 / 0.06);
    --y-sh-up: 0 -6px 16px -10px rgb(15 60 61 / 0.22);

    /* ---- Motion: short, functional, never looping (OD-PM-012). prefers-reduced-motion removes it (components) ---- */
    --y-dur-1: 120ms; /* hover, press, toggles */
    --y-dur-2: 180ms; /* panels, toasts, reveal */
    --y-ease: cubic-bezier(0.2, 0.7, 0.2, 1);

    /* ---- Sizes ---- */
    --y-tap: 2.75rem;          /* 44 px touch target */
    --y-field: 2.875rem;       /* 46 px fields */
    --y-rail: 15rem;           /* full side rail (≥ 80em) */
    --y-rail-compact: 7.5rem;  /* compact rail (47.5–80em) */
    --y-panel: 28rem;          /* operation panel beside the page (≥ 64em) */
    --y-dialog: 42rem;         /* centered dialog width (live .op-modal) — kept from the prototype */
    --y-bottom: 3.5rem;        /* phone bottom bar: 56 px + safe area */
    --y-head: 2.5rem;          /* sticky status line on wide screens — LIVE value (the prototype had 3.25rem) */
    --y-toast-h: 0px;          /* live: measured while a result is shown; 0 when none */
    --y-content: 76rem;        /* max width of the page column — kept from the prototype */

    /* ---- Layers (Masar's own order; the product shell may sit higher — see README) ---- */
    --y-z-head: 25; --y-z-rail: 30; --y-z-bottom: 35; --y-z-toast: 36; --y-z-panel: 40; --y-z-tools: 45; --y-z-modal: 50;
  }
}
