/* Semantic colours for the JSON-token editor (labels, repr line, token chrome).
   Each token is a channel TRIPLET, not a hex: the label colour, the 0.07-alpha
   fill and the 0.25-alpha border are all derived from one value here. The
   previous version spelled every colour three times (once as #rrggbb and twice
   inside an rgba(...)), so a change had to be made in three places by hand.

   Light mode needs its own set. The dark values are mid-tone pastels picked
   against #061221; measured against the light background (#f7f3ea) they land at
   2.1:1–3.0:1, i.e. below the 4.5:1 body-text floor and mostly below even the
   3:1 large-text one — the whole trade-capture form's labels read as a washed
   pastel smear in light mode. The light values below are the same hues walked
   down in lightness until each measures >= 4.5:1 on the ivory background. */
:root {
    --token-position-rgb:     192,  96,  78;
    --token-notional-rgb:     201, 148,  26;
    --token-instrument-rgb:    82, 168, 158;
    --token-rate-rgb:          72, 160, 112;
    --token-date-rgb:         128, 144, 170;
    --token-separator-rgb:     96, 104, 128;
    --token-type-rgb:         154, 132, 176;
    --token-end-of-month-rgb: 200, 164, 100;
    --token-generator-rgb:    180, 142, 173;
    --token-schedule-rgb:      90, 156, 140;
}

:root[data-cpd-theme="light"] {
    --token-position-rgb:     187,  76,  55;
    --token-notional-rgb:     144, 103,   9;
    --token-instrument-rgb:    52, 121, 113;
    --token-rate-rgb:          49, 125,  83;
    --token-date-rgb:          92, 112, 146;
    /* --token-separator is the one that needs no adjusting: #606880 already
       measures 5.0:1 on ivory, better than the 4.5 target, so darkening it
       would be a regression for no gain. */
    --token-type-rgb:         127,  96, 159;
    --token-end-of-month-rgb: 140, 104,  41;
    --token-generator-rgb:    148,  92, 137;
    --token-schedule-rgb:      63, 120, 106;
}

:root {
    --token-position:     rgb(var(--token-position-rgb));
    --token-notional:     rgb(var(--token-notional-rgb));
    --token-instrument:   rgb(var(--token-instrument-rgb));
    --token-rate:         rgb(var(--token-rate-rgb));
    --token-date:         rgb(var(--token-date-rgb));
    --token-separator:    rgb(var(--token-separator-rgb));
    --token-type:         rgb(var(--token-type-rgb));
    --token-end-of-month: rgb(var(--token-end-of-month-rgb));
    --token-generator:    rgb(var(--token-generator-rgb));
    --token-schedule:     rgb(var(--token-schedule-rgb));

    --token-position-bg:     rgba(var(--token-position-rgb), 0.07);
    --token-notional-bg:     rgba(var(--token-notional-rgb), 0.07);
    --token-instrument-bg:   rgba(var(--token-instrument-rgb), 0.07);
    --token-rate-bg:         rgba(var(--token-rate-rgb), 0.07);
    --token-date-bg:         rgba(var(--token-date-rgb), 0.07);
    --token-separator-bg:    rgba(var(--token-separator-rgb), 0.05);
    --token-type-bg:         rgba(var(--token-type-rgb), 0.07);
    --token-end-of-month-bg: rgba(var(--token-end-of-month-rgb), 0.07);
    --token-generator-bg:    rgba(var(--token-generator-rgb), 0.07);
    --token-schedule-bg:     rgba(var(--token-schedule-rgb), 0.07);

    --token-position-border:     rgba(var(--token-position-rgb), 0.25);
    --token-notional-border:     rgba(var(--token-notional-rgb), 0.25);
    --token-instrument-border:   rgba(var(--token-instrument-rgb), 0.25);
    --token-rate-border:         rgba(var(--token-rate-rgb), 0.25);
    --token-date-border:         rgba(var(--token-date-rgb), 0.25);
    --token-separator-border:    rgba(var(--token-separator-rgb), 0.18);
    --token-type-border:         rgba(var(--token-type-rgb), 0.25);
    --token-end-of-month-border: rgba(var(--token-end-of-month-rgb), 0.25);
    --token-generator-border:    rgba(var(--token-generator-rgb), 0.25);
    --token-schedule-border:     rgba(var(--token-schedule-rgb), 0.25);
}
