/* TechnoPulse.Ui.Charts: ChartFrame, ChartRow, StatTile, BarList, StackedBar, RiskMatrix and RiskBandKey
   (docs/ui/projects-charts-and-record-view.md; design K05). A host links this file after suite.css or its bundle, on
   the pages that draw a chart:
       <link rel="stylesheet" href="_content/TechnoPulse.Ui.Charts/css/charts.css" />
   The rules sit in the suite's components layer, so suite.css's layer order holds; tokens only
   (src/ui/.stylelintrc.json). HTML and CSS only: no SVG, no script.

   Colours. Every mark has a fill and an edge: the fill is the recognisable colour (the accent, amber, red, green, or
   for neutral the surface-2 grey, a hollow mark), the edge (an inset line of the border width, 2px in sunlight) is
   the matching text role or the strong border, at least 3:1 on the surface in every scheme, so every mark keeps 3:1
   against the page (WCAG 1.4.11) even where its fill does not. Text never takes a series colour; words and numbers
   sit beside the marks in the text colours. The fills are the same red, amber and green in every scheme (checked with
   the dataviz palette validator: red, amber and green stay at least 18 apart in OKLab for every colour vision; the
   lighter text-role red of the dark scheme was too close to amber, and a grey fill too close to the dark accent, so
   neutral is hollow). The risk bands are fixed colours in every scheme (the PDF's): they are 1.41:1 and 1.84:1 from
   their neighbours, so every matrix cell has a 3:1 outline and a surface gap, and numbers on a band take the band's
   own readable text colour (--color-on-risk-*). The position markers are ink with a white ring (or the reverse), so
   one of the two is 3:1 on any band.
     light     accent indigo 600 (6.0:1 on white); amber 2.16:1 edged in yellow 800 (7.5:1); red 600 5.6:1 (edge red
               700); green 600 5.1:1 (edge green 700); neutral edged in grey 500 (3.8:1)
     dark      accent indigo 400 (5.8:1 on the dark surface); amber 7.6:1; red 600 2.9:1 edged in red 300 (6.9:1);
               green 600 3.2:1 edged in green 300; neutral edged in grey 475 (4.5:1)
     sunlight  edges in red 900, yellow 900, green 900 and black, 2px
   Forced colours: bars turn CanvasText, the target Highlight; the parts, swatches and cells keep their own colours
   (forced-color-adjust: none, as colour swatches should) inside a CanvasText outline; words stay system text. */

@layer components {
    /* ---- Colours (aliases of roles, re-declared on every scope so a nested scheme or accent re-resolves) ---------- */

    :where(:root, [data-theme], [data-accent], [data-scheme]) {
        --chart-track: var(--color-surface-2);
        --chart-target: var(--color-text);
        --chart-fill-accent: var(--color-accent);
        --chart-edge-accent: var(--color-accent-text);
        --chart-fill-neutral: var(--color-surface-2);
        --chart-edge-neutral: var(--color-border-strong);
        --chart-fill-attention: var(--color-warning-solid);
        --chart-edge-attention: var(--color-warning-text);
        --chart-fill-danger: var(--color-danger-solid);
        --chart-edge-danger: var(--color-danger-text);
        --chart-fill-success: var(--color-success-solid);
        --chart-edge-success: var(--color-success-text);
        --chart-cell-outline: var(--color-border-strong);
        --chart-gap: 0.125rem;
        /* An empty matrix cell is this much of its band's fill over the surface. */
        --chart-empty-tint: 22%;
        /* The risk position markers sit on the fixed band fills, so they use the fixed ink and white of those fills. */
        --chart-marker-ink: var(--color-on-risk-medium);
        --chart-marker-ring: var(--color-on-risk-very-high);
    }

    :is(.tp-bar-list__row, .tp-stacked-bar__part, .tp-stacked-bar__entry)[data-tone="accent"] { --chart-fill: var(--chart-fill-accent); --chart-edge: var(--chart-edge-accent); }
    :is(.tp-bar-list__row, .tp-stacked-bar__part, .tp-stacked-bar__entry)[data-tone="neutral"] { --chart-fill: var(--chart-fill-neutral); --chart-edge: var(--chart-edge-neutral); }
    :is(.tp-bar-list__row, .tp-stacked-bar__part, .tp-stacked-bar__entry)[data-tone="attention"] { --chart-fill: var(--chart-fill-attention); --chart-edge: var(--chart-edge-attention); }
    :is(.tp-bar-list__row, .tp-stacked-bar__part, .tp-stacked-bar__entry)[data-tone="danger"] { --chart-fill: var(--chart-fill-danger); --chart-edge: var(--chart-edge-danger); }
    :is(.tp-bar-list__row, .tp-stacked-bar__part, .tp-stacked-bar__entry)[data-tone="success"] { --chart-fill: var(--chart-fill-success); --chart-edge: var(--chart-edge-success); }

    :is(.tp-risk-matrix__spot, .tp-risk-key__swatch)[data-band="low"] { --band-fill: var(--color-risk-low); --band-on: var(--color-on-risk-low); }
    :is(.tp-risk-matrix__spot, .tp-risk-key__swatch)[data-band="medium"] { --band-fill: var(--color-risk-medium); --band-on: var(--color-on-risk-medium); }
    :is(.tp-risk-matrix__spot, .tp-risk-key__swatch)[data-band="high"] { --band-fill: var(--color-risk-high); --band-on: var(--color-on-risk-high); }
    :is(.tp-risk-matrix__spot, .tp-risk-key__swatch)[data-band="very-high"] { --band-fill: var(--color-risk-very-high); --band-on: var(--color-on-risk-very-high); }

    /* ---- ChartFrame and ChartRow --------------------------------------------------------------------------------- */

    .tp-chart {
        display: flex;
        flex-direction: column;
        gap: var(--space-3);
        min-inline-size: 0;
        margin: 0;
        color: var(--color-text);
    }

    .tp-chart__caption { display: flex; flex-direction: column; gap: var(--space-1); }

    .tp-chart__title {
        margin: 0;
        font-size: var(--font-size-lg);
        font-weight: var(--font-weight-semibold);
        line-height: var(--line-height-snug);
    }

    .tp-chart__summary { max-inline-size: 70ch; margin: 0; line-height: var(--line-height-normal); }

    .tp-chart__body { display: flex; flex-direction: column; gap: var(--space-3); min-inline-size: 0; }

    .tp-chart__table-toggle {
        display: list-item;
        inline-size: fit-content;
        min-block-size: var(--target-size-min);
        padding-block: var(--space-1);
        color: var(--color-accent-text);
        font-weight: var(--font-weight-medium);
        text-decoration: underline;
        text-underline-offset: 0.15em;
        cursor: pointer;
    }

    .tp-chart__table-toggle:hover { text-decoration-thickness: 2px; }

    .tp-chart-table {
        inline-size: 100%;
        margin-block-start: var(--space-2);
        border-collapse: collapse;
        font-size: var(--font-size-sm);
        line-height: var(--line-height-snug);
    }

    .tp-chart-table :is(th, td) {
        padding: var(--space-2);
        border-block-end: var(--border-width) solid var(--color-border);
        text-align: start;
        vertical-align: top;
        overflow-wrap: anywhere;
    }

    .tp-chart-table thead th { border-block-end-color: var(--color-border-strong); font-weight: var(--font-weight-semibold); }
    .tp-chart-table tbody th { font-weight: var(--font-weight-regular); }
    .tp-chart-table :is(td, thead th:not(:first-child)) { text-align: end; font-variant-numeric: var(--font-numeric-data); }

    .tp-chart-row {
        --chart-row-min: 17rem;

        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--chart-row-min)), 1fr));
        gap: var(--space-6);
        align-items: start;
    }

    /* ---- StatTile ------------------------------------------------------------------------------------------------ */

    .tp-stat-tiles {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 10rem), 1fr));
        gap: var(--space-3);
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .tp-stat-tile { --stat-tile-edge: var(--color-border); display: flex; min-inline-size: 0; }
    .tp-stat-tile[data-tone="accent"] { --stat-tile-edge: var(--chart-edge-accent); }
    .tp-stat-tile[data-tone="attention"] { --stat-tile-edge: var(--chart-edge-attention); }
    .tp-stat-tile[data-tone="danger"] { --stat-tile-edge: var(--chart-edge-danger); }
    .tp-stat-tile[data-tone="success"] { --stat-tile-edge: var(--chart-edge-success); }

    .tp-stat-tile__body {
        display: flex;
        flex: 1;
        flex-direction: column;
        gap: var(--space-1);
        min-inline-size: 0;
        padding: var(--space-3) var(--space-4);
        border: var(--border-width) solid var(--color-border);
        border-inline-start: var(--space-1) solid var(--stat-tile-edge);
        border-radius: var(--radius-md);
        background: var(--color-surface);
        color: var(--color-text);
        line-height: var(--line-height-snug);
        text-decoration: none;
    }

    /* The number has the tile's whole width; it breaks only where it cannot fit at all (very large text). */
    .tp-stat-tile__value {
        font-size: var(--font-size-3xl);
        font-weight: var(--font-weight-semibold);
        line-height: var(--line-height-tight);
        overflow-wrap: break-word;
    }

    .tp-stat-tile__label { display: flex; align-items: flex-start; gap: var(--space-1); font-weight: var(--font-weight-medium); }
    .tp-stat-tile__icon { --icon-size: var(--icon-size-md); color: var(--stat-tile-edge); }
    .tp-stat-tile__words { min-inline-size: 0; overflow-wrap: break-word; }
    .tp-stat-tile__detail { color: var(--color-text-muted); font-size: var(--font-size-sm); }

    .tp-stat-tile__link .tp-stat-tile__words { text-decoration: underline; text-underline-offset: 0.15em; }
    .tp-stat-tile__link:hover { background: var(--color-surface-2); }
    .tp-stat-tile__link:hover .tp-stat-tile__words { text-decoration-thickness: 2px; }

    /* ---- BarList ------------------------------------------------------------------------------------------------- */

    .tp-bar-list {
        container: tp-bar-list / inline-size;
        display: flex;
        flex-direction: column;
        gap: var(--space-2);
        min-inline-size: 0;
    }

    /* Narrow: the label and value share a line and the bar runs under them. The rows are subgrids of the list, so
       the columns line up from row to row. */
    .tp-bar-list__rows {
        display: grid;
        grid-template-columns: minmax(0, 1fr) fit-content(50%);
        row-gap: var(--space-1);
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .tp-bar-list__row,
    .tp-bar-list__item {
        display: grid;
        grid-column: 1 / -1;
        grid-template-columns: subgrid;
    }

    .tp-bar-list__item {
        align-items: center;
        gap: var(--space-1) var(--space-3);
        padding: var(--space-1) var(--space-2);
        border-radius: var(--radius-sm);
        color: var(--color-text);
        text-decoration: none;
    }

    .tp-bar-list__label { grid-column: 1; grid-row: 1; min-inline-size: 0; overflow-wrap: anywhere; }
    .tp-bar-list__name { display: block; font-weight: var(--font-weight-medium); }
    .tp-bar-list__note { display: block; color: var(--color-text-muted); font-size: var(--font-size-sm); }

    .tp-bar-list__value {
        grid-column: 2;
        grid-row: 1;
        font-variant-numeric: var(--font-numeric-data);
        font-weight: var(--font-weight-semibold);
        text-align: end;
    }

    .tp-bar-list__track {
        position: relative;
        display: block;
        grid-column: 1 / -1;
        grid-row: 2;
        block-size: 0.75rem;
        margin-block: var(--space-1);
        background: var(--chart-track);
    }

    /* Square at the baseline, rounded at the value's end. */
    .tp-bar-list__fill {
        display: block;
        block-size: 100%;
        border-start-end-radius: var(--radius-xs);
        border-end-end-radius: var(--radius-xs);
        background: var(--chart-fill);
        box-shadow: inset 0 0 0 var(--border-width) var(--chart-edge);
    }

    .tp-bar-list__target,
    .tp-bar-list__key-mark {
        inline-size: 0.1875rem;
        background: var(--chart-target);
    }

    .tp-bar-list__target {
        position: absolute;
        inset-block: calc(var(--space-1) * -1);
        margin-inline-start: -0.09375rem;
    }

    .tp-bar-list__key {
        display: flex;
        align-items: center;
        gap: var(--space-2);
        margin: 0;
        color: var(--color-text-muted);
        font-size: var(--font-size-sm);
    }

    .tp-bar-list__key-mark { flex: none; block-size: 1.25rem; }

    .tp-bar-list__link .tp-bar-list__name { text-decoration: underline; text-underline-offset: 0.15em; }
    .tp-bar-list__link:hover { background: var(--color-surface-2); }
    .tp-bar-list__link:hover .tp-bar-list__name { text-decoration-thickness: 2px; }

    /* Wide: label, bar and value on one line, the labels in a column of their own. */
    @container tp-bar-list (min-width: 32rem) {
        .tp-bar-list__rows { grid-template-columns: fit-content(16rem) minmax(0, 1fr) fit-content(14rem); }
        .tp-bar-list__track { grid-column: 2; grid-row: 1; margin-block: 0; }
        .tp-bar-list__value { grid-column: 3; }
    }

    /* ---- StackedBar ---------------------------------------------------------------------------------------------- */

    .tp-stacked-bar { display: flex; flex-direction: column; gap: var(--space-3); min-inline-size: 0; }

    .tp-stacked-bar__bar { display: flex; gap: var(--chart-gap); block-size: 1.5rem; }

    .tp-stacked-bar__bar[data-empty] {
        border: var(--border-width) dashed var(--color-border-strong);
        border-radius: var(--radius-xs);
    }

    .tp-stacked-bar__part {
        flex: 0 1 0;
        min-inline-size: 0.25rem;
        background: var(--chart-fill);
        box-shadow: inset 0 0 0 var(--border-width) var(--chart-edge);
    }

    .tp-stacked-bar__part:first-child { border-start-start-radius: var(--radius-xs); border-end-start-radius: var(--radius-xs); }
    .tp-stacked-bar__part:last-child { border-start-end-radius: var(--radius-xs); border-end-end-radius: var(--radius-xs); }

    .tp-stacked-bar__key {
        display: flex;
        flex-wrap: wrap;
        gap: var(--space-1) var(--space-5);
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .tp-stacked-bar__item {
        display: inline-flex;
        align-items: center;
        gap: var(--space-2);
        min-block-size: var(--target-size-min);
        color: var(--color-text);
        text-decoration: none;
    }

    .tp-stacked-bar__swatch {
        flex: none;
        inline-size: 0.875rem;
        block-size: 0.875rem;
        border-radius: var(--radius-xs);
        background: var(--chart-fill);
        box-shadow: inset 0 0 0 var(--border-width) var(--chart-edge);
    }

    .tp-stacked-bar__value { font-variant-numeric: var(--font-numeric-data); font-weight: var(--font-weight-semibold); }

    .tp-stacked-bar__link .tp-stacked-bar__label { text-decoration: underline; text-underline-offset: 0.15em; }
    .tp-stacked-bar__link:hover .tp-stacked-bar__label { text-decoration-thickness: 2px; }

    /* ---- RiskMatrix ---------------------------------------------------------------------------------------------- */

    .tp-risk-matrix {
        container: tp-risk-matrix / inline-size;
        display: flex;
        flex-direction: column;
        gap: var(--space-3);
        min-inline-size: 0;
        max-inline-size: 26rem;
        color: var(--color-text);
    }

    .tp-risk-matrix__title { margin: 0; font-weight: var(--font-weight-semibold); }

    /* The markers and the arrow stack inside the matrix only. */
    .tp-risk-matrix__frame { position: relative; isolation: isolate; }

    /* The axis columns are in em of the matrix's small text, so they grow with the text size. */
    .tp-risk-matrix__grid {
        inline-size: 100%;
        font-size: var(--font-size-sm);
        table-layout: fixed;
        border-collapse: separate;
        border-spacing: var(--chart-gap);
    }

    .tp-risk-matrix__grid :is(td, th) { padding: 0; }
    .tp-risk-matrix__col-axis { inline-size: 1.75em; }
    .tp-risk-matrix__col-ticks { inline-size: 1.5em; }

    .tp-risk-matrix__tick {
        color: var(--color-text-muted);
        font-size: var(--font-size-sm);
        font-variant-numeric: var(--font-numeric-data);
        font-weight: var(--font-weight-regular);
        text-align: center;
    }

    tbody .tp-risk-matrix__tick { padding-inline-end: var(--space-1); text-align: end; }
    tfoot .tp-risk-matrix__tick { padding-block-start: var(--space-1); }

    /* A cell is square: the column's width, at least the 24px target. Its own width is the unit of the markers and
       the arrow (container query units). */
    .tp-risk-matrix__spot {
        position: relative;
        container-type: inline-size;
        display: grid;
        place-items: center;
        inline-size: 100%;
        min-block-size: var(--target-size-min);
        aspect-ratio: 1;
        border: var(--border-width) solid var(--chart-cell-outline);
        border-radius: var(--radius-xs);
        background: color-mix(in srgb, var(--band-fill) var(--chart-empty-tint), var(--color-surface));
        color: var(--band-on);
        font-size: var(--font-size-md);
        font-variant-numeric: var(--font-numeric-data);
        font-weight: var(--font-weight-bold);
        line-height: 1;
        text-decoration: none;
    }

    .tp-risk-matrix__spot[data-filled] { background: var(--band-fill); }

    .tp-risk-matrix__link:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.15em; }
    .tp-risk-matrix__link:hover::after {
        position: absolute;
        inset: 0.125rem;
        border: 0.125rem solid var(--band-on);
        border-radius: var(--radius-xs);
        content: "";
    }

    /* Hollow before, filled after; each ringed in the other colour so it shows on every band. */
    .tp-risk-matrix__marker {
        position: absolute;
        inset-block-start: 50%;
        inset-inline-start: 50%;
        z-index: calc(var(--z-raised) + 1);
        border-radius: 50%;
        translate: -50% -50%;
    }

    .tp-risk-matrix__marker--before {
        inline-size: 56cqi;
        block-size: 56cqi;
        border: 0.1875rem solid var(--chart-marker-ink);
        box-shadow: 0 0 0 0.125rem var(--chart-marker-ring), inset 0 0 0 0.125rem var(--chart-marker-ring);
    }

    .tp-risk-matrix__marker--after {
        inline-size: 30cqi;
        block-size: 30cqi;
        background: var(--chart-marker-ink);
        box-shadow: 0 0 0 0.125rem var(--chart-marker-ring);
    }

    /* From the before cell's centre towards the after cell's: --risk-arrow-length cells long (a cell is its width
       plus the gap), turned --risk-arrow-angle clockwise; the shaft starts outside the ring and the head stops at the
       dot. A white casing keeps it 3:1 on every band. */
    .tp-risk-matrix__arrow {
        --risk-arrow-from: calc(28cqi + 0.25rem);
        --risk-arrow-to: calc(15cqi + 0.25rem);
        --risk-arrow-head: 0.625rem;

        position: absolute;
        inset-block-start: 50%;
        inset-inline-start: 50%;
        z-index: var(--z-raised);
        inline-size: calc(var(--risk-arrow-length) * (100cqi + var(--chart-gap)));
        block-size: 0;
        transform-origin: 0 0;
        rotate: var(--risk-arrow-angle);
        filter: drop-shadow(0.0625rem 0 0 var(--chart-marker-ring)) drop-shadow(-0.0625rem 0 0 var(--chart-marker-ring))
            drop-shadow(0 0.0625rem 0 var(--chart-marker-ring)) drop-shadow(0 -0.0625rem 0 var(--chart-marker-ring));
        pointer-events: none;
    }

    .tp-risk-matrix__arrow::before,
    .tp-risk-matrix__arrow::after {
        position: absolute;
        background: var(--chart-marker-ink);
        content: "";
    }

    .tp-risk-matrix__arrow::before {
        inset-block-start: -0.09375rem;
        inset-inline: var(--risk-arrow-from) calc(var(--risk-arrow-to) + var(--risk-arrow-head) - 0.0625rem);
        block-size: 0.1875rem;
    }

    .tp-risk-matrix__arrow::after {
        inset-block-start: calc(var(--risk-arrow-head) / -2);
        inset-inline-end: var(--risk-arrow-to);
        inline-size: var(--risk-arrow-head);
        block-size: var(--risk-arrow-head);
        clip-path: polygon(0 0, 100% 50%, 0 100%);
    }

    /* The axis titles and end words: under the columns, and up the side (read bottom to top), where the end words
       show only when there is room. Screen readers hear them in the row and column headers instead. */
    .tp-risk-matrix__axis { color: var(--color-text-muted); font-size: var(--font-size-xs); line-height: var(--line-height-tight); }

    .tp-risk-matrix__axis-text {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        gap: var(--space-2);
    }

    .tp-risk-matrix__axis-title { grid-column: 2; color: var(--color-text); font-size: var(--font-size-sm); font-weight: var(--font-weight-semibold); }
    .tp-risk-matrix__end--low { grid-column: 1; justify-self: start; }
    .tp-risk-matrix__end--high { grid-column: 3; justify-self: end; text-align: end; }

    .tp-risk-matrix__axis--across { padding-block-start: var(--space-1); }
    .tp-risk-matrix__axis--up { position: relative; }

    .tp-risk-matrix__axis--up .tp-risk-matrix__axis-text {
        position: absolute;
        inset: 0;
        rotate: 180deg;
        white-space: nowrap;
        writing-mode: vertical-rl;
    }

    .tp-risk-matrix__axis--up .tp-risk-matrix__end { display: none; }

    @container tp-risk-matrix (min-width: 22em) {
        .tp-risk-matrix__axis--up .tp-risk-matrix__end { display: block; }
    }

    /* Position mode's words: a ring and a dot like the matrix's, in the text colour. */
    .tp-risk-matrix__positions {
        display: flex;
        flex-direction: column;
        gap: var(--space-2);
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .tp-risk-matrix__position { display: flex; align-items: flex-start; gap: var(--space-2); }
    .tp-risk-matrix__position-body { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); }

    .tp-risk-matrix__key-marker { flex: none; inline-size: 1rem; block-size: 1rem; margin-block-start: 0.2em; border-radius: 50%; }
    .tp-risk-matrix__key-marker--before { border: 0.1875rem solid var(--color-text); }
    .tp-risk-matrix__key-marker--after { background: var(--color-text); clip-path: circle(30%); }

    /* ---- RiskBandKey --------------------------------------------------------------------------------------------- */

    .tp-risk-key {
        display: flex;
        flex-wrap: wrap;
        gap: var(--space-1) var(--space-4);
        margin: 0;
        padding: 0;
        font-size: var(--font-size-sm);
        list-style: none;
    }

    .tp-risk-key__band { display: inline-flex; align-items: center; gap: var(--space-2); }

    .tp-risk-key__swatch {
        flex: none;
        inline-size: 1rem;
        block-size: 1rem;
        border: var(--border-width) solid var(--chart-cell-outline);
        border-radius: var(--radius-xs);
        background: var(--band-fill);
    }

    .tp-risk-key__scores { color: var(--color-text-muted); }

    /* ---- Focus --------------------------------------------------------------------------------------------------- */

    :is(.tp-chart__table-toggle, .tp-stat-tile__link, .tp-bar-list__link, .tp-stacked-bar__link):focus-visible {
        outline: var(--focus-width) solid var(--color-focus);
        outline-offset: var(--focus-offset);
        box-shadow: 0 0 0 calc(var(--focus-width) + var(--focus-offset)) var(--color-focus-halo);
    }

    /* A matrix cell's ring sits over its neighbours: lifted above them, with a surface ring between the cell and it. */
    .tp-risk-matrix__link:focus-visible {
        z-index: calc(var(--z-raised) + 1);
        outline: var(--focus-width) solid var(--color-focus);
        outline-offset: var(--focus-offset);
        box-shadow: 0 0 0 var(--focus-offset) var(--color-surface);
    }

    @media (forced-colors: active) {
        .tp-stat-tile__body { border-color: CanvasText; }
        .tp-bar-list__track { outline: 1px solid CanvasText; }
        .tp-bar-list__fill { background: CanvasText; }
        :is(.tp-bar-list__target, .tp-bar-list__key-mark) { background: Highlight; }

        :is(.tp-stacked-bar__part, .tp-stacked-bar__swatch, .tp-risk-matrix__spot, .tp-risk-key__swatch) {
            outline: 1px solid CanvasText;
            forced-color-adjust: none;
        }

        .tp-risk-matrix__link:focus-visible { outline: var(--focus-width) solid Highlight; }
        .tp-risk-matrix__key-marker--before { border-color: CanvasText; }
        .tp-risk-matrix__key-marker--after { background: CanvasText; }
    }
}
