/* ==== Risk Register — components (RR_Design) ==========================================================================
   Classes of templates/components/*.php. Needs tokens.css and base.css.
   ===================================================================================================================== */
/* card / panel */
.card { background: var(--rr-surface); border: 1px solid var(--rr-line); border-radius: var(--rr-radius-lg); box-shadow: var(--rr-shadow); }
.card__head { display: flex; align-items: center; gap: var(--rr-space-3); padding: var(--rr-space-3) var(--rr-space-4); border-bottom: 1px solid var(--rr-line); }
.card__head h2, .card__head h3 { margin: 0; font-family: var(--rr-font); font-size: var(--rr-fs-md); }
.card__body { padding: var(--rr-space-4); }
.card__foot { padding: var(--rr-space-3) var(--rr-space-4); background: var(--rr-surface-alt); border-top: 1px solid var(--rr-line); border-radius: 0 0 var(--rr-radius-lg) var(--rr-radius-lg); display: flex; gap: var(--rr-space-2); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 var(--rr-space-4);
  font: 600 var(--rr-fs)/1 var(--rr-font); letter-spacing: 0.01em; white-space: nowrap; text-decoration: none;
  color: var(--rr-text); background: var(--rr-surface);
  border: 1px solid var(--rr-line-strong); border-radius: var(--rr-radius);
  cursor: pointer; transition: background-color .15s ease, border-color .15s ease, transform .05s ease;
}
.btn:hover { border-color: var(--rr-line-hover); background: var(--rr-surface-head); color: var(--rr-text); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { box-shadow: var(--rr-ring); border-radius: var(--rr-radius); }
.btn--primary { background: var(--rr-accent); border-color: var(--rr-accent); color: var(--rr-accent-ink); }
.btn--primary:hover { background: var(--rr-accent-hover); border-color: var(--rr-accent-hover); }
.btn--dark { background: var(--rr-eni-black); border-color: var(--rr-eni-black); color: var(--rr-white); }
.btn--dark:hover { background: #000; color: var(--rr-white); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--rr-text); }
.btn--ghost:hover { background: var(--rr-surface-head); border-color: transparent; }
.btn--danger { background: var(--rr-bad); border-color: var(--rr-bad); color: var(--rr-white); }
.btn--danger:hover { background: var(--rr-bad-text); border-color: var(--rr-bad-text); color: var(--rr-white); }
.btn--sm { height: 28px; padding: 0 10px; font-size: var(--rr-fs-sm); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn .ico { font-size: 1.1em; line-height: 1; }

/* form fields */
.form-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--rr-space-4) var(--rr-space-5); }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; }
.span-6 { grid-column: span 6; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field__label { font-weight: 600; font-size: var(--rr-fs-sm); color: var(--rr-text); display: flex; align-items: center; gap: 6px; }
.field__req { color: var(--rr-bad-text); }
.field__hint { font-size: var(--rr-fs-sm); color: var(--rr-text-dim); }
.field__error { font-size: var(--rr-fs-sm); color: var(--rr-bad-text); font-weight: 600; }
.field__error::before { content: "⚠ "; }
.input, .select, .textarea {
  width: 100%; height: 36px; padding: 0 10px;
  font: var(--rr-fs)/1.4 var(--rr-font); color: var(--rr-text);
  background: var(--rr-surface); border: 1px solid var(--rr-line-strong); border-radius: var(--rr-radius);
  box-shadow: var(--rr-inset); transition: border-color .15s ease, box-shadow .15s ease;
}
.textarea { height: auto; min-height: 84px; padding: 8px 10px; resize: vertical; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--rr-line-hover); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { border-color: var(--rr-eni-black); box-shadow: var(--rr-inset), var(--rr-ring); border-radius: var(--rr-radius); }
.input::placeholder, .textarea::placeholder { color: var(--rr-placeholder); }
.input[readonly], .input:disabled, .select:disabled, .textarea:disabled, .textarea[readonly] { background: var(--rr-surface-alt); color: var(--rr-text-dim); box-shadow: none; cursor: not-allowed; }
.input[readonly], .textarea[readonly] { cursor: auto; }
.input--mono { font-family: var(--rr-font-mono); }
.field--error .input, .field--error .select, .field--error .textarea { border-color: var(--rr-bad); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check-group { display: flex; flex-wrap: wrap; gap: var(--rr-space-2) var(--rr-space-4); padding: 8px 10px; border: 1px solid var(--rr-line); border-radius: var(--rr-radius); background: var(--rr-surface); }
fieldset.fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
fieldset.fieldset > legend { padding: 0; margin-bottom: 4px; font-weight: 600; font-size: var(--rr-fs-sm); }
.hold-toggle { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; font-weight: 400; font-size: var(--rr-fs-xs); color: var(--rr-text-dim); }
.form-section { margin: var(--rr-space-5) 0 var(--rr-space-3); padding-bottom: 6px; border-bottom: 1px solid var(--rr-line); font-family: var(--rr-font-display); font-size: 18px; }
.form-section:first-child { margin-top: 0; }

/* multi-select tokens (pick-lists) — enhanced by JS, plain <select multiple> without it */
.token-input { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 36px; padding: 4px 6px; border: 1px solid var(--rr-line-strong); border-radius: var(--rr-radius); background: var(--rr-surface); }
.token { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; border-radius: 999px; background: var(--rr-surface-head); font-size: var(--rr-fs-sm); }
.token button { border: 0; background: none; cursor: pointer; padding: 0 4px; font-size: 14px; line-height: 1; color: var(--rr-text-dim); border-radius: 50%; }
.token-input input { flex: 1; min-width: 120px; border: 0; outline: 0; font: inherit; height: 26px; }

/* flash messages (kinds success / info / warning / danger) */
.flash { display: flex; gap: var(--rr-space-3); align-items: flex-start; padding: var(--rr-space-3) var(--rr-space-4); margin-bottom: var(--rr-space-3); border: 1px solid; border-left-width: 4px; border-radius: var(--rr-radius); color: var(--rr-text); }
.flash__icon { font-weight: 600; width: 18px; text-align: center; }
.flash__body { flex: 1; }
.flash__title { font-weight: 600; }
.flash__close { margin-left: auto; border: 0; background: none; cursor: pointer; font-size: 18px; line-height: 1; color: var(--rr-text-dim); padding: 0 4px; border-radius: var(--rr-radius-sm); }
.flash--success { background: var(--rr-ok-tint);   border-color: #b5dcc6; border-left-color: var(--rr-ok); }
.flash--success .flash__icon, .flash--success .flash__title { color: var(--rr-ok-text); }
.flash--info    { background: var(--rr-info-tint); border-color: #b9d1ea; border-left-color: var(--rr-info); }
.flash--info .flash__icon, .flash--info .flash__title { color: var(--rr-info-text); }
.flash--warning { background: var(--rr-warn-tint); border-color: #f0d98c; border-left-color: var(--rr-warn); }
.flash--warning .flash__icon, .flash--warning .flash__title { color: var(--rr-warn-text); }
.flash--danger  { background: var(--rr-bad-tint);  border-color: #f0bcbc; border-left-color: var(--rr-bad); }
.flash--danger .flash__icon, .flash--danger .flash__title { color: var(--rr-bad-text); }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: var(--rr-fs-xs); font-weight: 600; letter-spacing: 0.03em; line-height: 18px; white-space: nowrap; background: var(--rr-surface-head); color: var(--rr-text); }
.badge--ok   { background: var(--rr-ok-tint);   color: var(--rr-ok-text); }
.badge--info { background: var(--rr-info-tint); color: var(--rr-info-text); }
.badge--warn { background: var(--rr-warn-tint); color: var(--rr-warn-text); }
.badge--bad  { background: var(--rr-bad-tint);  color: var(--rr-bad-text); }
.badge--dark { background: var(--rr-eni-black); color: var(--rr-white); }
.badge--count { font-family: var(--rr-font-mono); min-width: 24px; justify-content: center; }
/* HOLD: value pending (S4.3.1). Dashed outline + hatched fill so it never reads as a status colour or risk level. */
.badge--hold {
  font-family: var(--rr-font-mono); letter-spacing: 0.08em;
  color: var(--rr-text); border: 1px dashed var(--rr-eni-black);
  background: repeating-linear-gradient(135deg, var(--rr-accent-tint) 0 4px, var(--rr-surface) 4px 8px);
}
.badge--hold::before { content: "⏸"; font-size: 10px; letter-spacing: 0; }

/* risk-level chip: code in mono + level name as text (never colour alone) */
.risk-chip { display: inline-flex; align-items: stretch; border-radius: var(--rr-radius-sm); overflow: hidden; font-size: var(--rr-fs-sm); font-weight: 600; line-height: 22px; white-space: nowrap; border: 1px solid rgba(34, 34, 34, 0.25); }
.risk-chip__code { padding: 0 6px; font-family: var(--rr-font-mono); background: var(--rr-surface); color: var(--rr-text); }
.risk-chip__level { padding: 0 8px; }
.risk-chip--low .risk-chip__level       { background: var(--rr-risk-low);       color: var(--rr-risk-low-ink); }
.risk-chip--medium .risk-chip__level    { background: var(--rr-risk-medium);    color: var(--rr-risk-medium-ink); }
.risk-chip--high .risk-chip__level      { background: var(--rr-risk-high);      color: var(--rr-risk-high-ink); }
.risk-chip--very-high .risk-chip__level { background: var(--rr-risk-very-high); color: var(--rr-risk-very-high-ink); }
.risk-chip--none .risk-chip__level      { background: var(--rr-surface-head);   color: var(--rr-text); }
.risk-chip--compact .risk-chip__level { padding: 0; width: 10px; overflow: hidden; text-indent: 100%; white-space: nowrap; } /* colour strip + code; the level name stays in the DOM for screen readers and in title */

/* ✕ mark (boolean true, like the Excel) */
.xmark { font-weight: 600; color: var(--rr-text); }
.xmark--no { color: transparent; }

/* tables */
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; background: var(--rr-surface); }
.table th, .table td { padding: 8px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rr-line); }
.table thead th { background: var(--rr-surface-head); color: var(--rr-text); font-size: var(--rr-fs-sm); font-weight: 600; vertical-align: bottom; border-bottom: 1px solid var(--rr-line-strong); }
.table tbody tr:nth-child(even) td { background: var(--rr-surface-alt); }
.table tbody tr:hover td { background: var(--rr-accent-wash); }
.table td.c, .table th.c { text-align: center; }
.table td.r, .table th.r { text-align: right; }
.table-card { border: 1px solid var(--rr-line); border-radius: var(--rr-radius-lg); overflow: hidden; box-shadow: var(--rr-shadow); background: var(--rr-surface); }
.table-card .table tbody tr:last-child td { border-bottom: 0; }

/* sort control in a header */
.sort { display: inline-flex; align-items: center; gap: 4px; color: inherit; text-decoration: none; }
.sort::after { content: "↕"; font-size: 11px; color: var(--rr-text-dim); }
.sort[aria-sort="ascending"]::after, .sort--asc::after { content: "▲"; color: var(--rr-text); font-size: 9px; }
.sort--desc::after { content: "▼"; color: var(--rr-text); font-size: 9px; }

/* toolbar above a table */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--rr-space-2); margin-bottom: var(--rr-space-3); }
.toolbar__spacer { flex: 1; }
.toolbar__count { font-size: var(--rr-fs-sm); color: var(--rr-text-dim); }

/* active-filter chips */
.filter-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: var(--rr-space-3); }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 10px; border-radius: 999px; background: var(--rr-accent-tint); border: 1px solid #e8c200; font-size: var(--rr-fs-sm); }
.filter-chip b { font-weight: 600; }
.filter-chip a { display: inline-flex; width: 18px; height: 18px; align-items: center; justify-content: center; border-radius: 50%; color: var(--rr-text); text-decoration: none; }
.filter-chip a:hover { background: rgba(34, 34, 34, 0.1); }

/* popover (column filter, column chooser) — <details>, works without JS */
.pop { position: relative; display: inline-block; }
.pop > summary { list-style: none; cursor: pointer; }
.pop > summary::-webkit-details-marker { display: none; }
.pop__panel { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; width: 260px; padding: var(--rr-space-3); background: var(--rr-surface); color: var(--rr-text); border: 1px solid var(--rr-line); border-radius: var(--rr-radius); box-shadow: var(--rr-shadow-pop); font-size: var(--rr-fs-sm); font-weight: 400; text-align: left; white-space: normal; writing-mode: horizontal-tb; transform: none; }
.pop__panel--right { left: auto; right: 0; }
.pop__panel h4 { margin: 0 0 8px; font-size: var(--rr-fs-sm); }
.pop__list { max-height: 200px; overflow: auto; display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.pop__foot { display: flex; gap: 6px; justify-content: flex-end; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--rr-line); }
.filter-btn { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 4px; color: var(--rr-text-dim); font-size: 11px; border: 1px solid transparent; }
.filter-btn:hover { background: rgba(34, 34, 34, 0.08); color: var(--rr-text); }
.filter-btn--on { background: var(--rr-accent); color: var(--rr-accent-ink); border-color: var(--rr-eni-black); }

/* pager */
.pager { display: flex; align-items: center; gap: 4px; font-size: var(--rr-fs-sm); }
.pager a, .pager span { min-width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; padding: 0 8px; border: 1px solid var(--rr-line); border-radius: var(--rr-radius); background: var(--rr-surface); color: var(--rr-text); text-decoration: none; }
.pager [aria-current="page"] { background: var(--rr-accent); border-color: var(--rr-accent); color: var(--rr-accent-ink); font-weight: 600; }

/* definition grid (register header block, risk detail) */
.meta { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--rr-space-3) var(--rr-space-5); margin: 0; }
.meta > div { min-width: 0; }
.meta dt { font-size: var(--rr-fs-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--rr-text-dim); margin-bottom: 2px; }
.meta dd { margin: 0; font-weight: 600; }
.meta .wide { grid-column: span 2; } .meta .full { grid-column: 1 / -1; }

/* tree (home: clients → sites → registers) */
.tree { list-style: none; margin: 0; padding: 0; }
.tree details > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 10px var(--rr-space-4); border-radius: var(--rr-radius); }
.tree details > summary::-webkit-details-marker { display: none; }
.tree details > summary::before { content: "▸"; width: 12px; color: var(--rr-text-dim); transition: transform .12s ease; }
.tree details[open] > summary::before { transform: rotate(90deg); }
.tree summary:hover { background: var(--rr-surface-alt); }
.tree__client > details > summary { font-family: var(--rr-font-display); font-size: 20px; font-weight: 600; }
.tree__sites { list-style: none; margin: 0 0 var(--rr-space-3) 22px; padding: 0 0 0 var(--rr-space-3); border-left: 2px solid var(--rr-line); }
.tree__site > details > summary { font-weight: 600; }
.tree__meta { margin-left: auto; display: flex; gap: var(--rr-space-4); font-size: var(--rr-fs-sm); color: var(--rr-text-dim); font-weight: 400; font-family: var(--rr-font); }
.tree__regs { list-style: none; margin: 0 0 var(--rr-space-2) 34px; padding: 0; }
.tree__reg { display: grid; grid-template-columns: 1fr 120px 90px 170px 90px; align-items: center; gap: var(--rr-space-4); padding: 8px var(--rr-space-4); border-radius: var(--rr-radius); }
.tree__reg:hover { background: var(--rr-accent-wash); }
.tree__reg a { font-weight: 600; color: var(--rr-text); text-decoration: none; }
.tree__reg a:hover { text-decoration: underline; }
.tree__reg a::before { content: "▤"; margin-right: 8px; color: var(--rr-text-dim); }

/* tabs (risk detail) */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rr-line-strong); margin-bottom: var(--rr-space-4); }
.tabs a { padding: 8px 14px; color: var(--rr-text-dim); font-weight: 600; text-decoration: none; border-radius: var(--rr-radius) var(--rr-radius) 0 0; border: 1px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--rr-text); background: var(--rr-surface-head); }
.tabs a[aria-current="page"] { color: var(--rr-text); background: var(--rr-surface); border-color: var(--rr-line-strong); border-bottom-color: var(--rr-surface); box-shadow: inset 0 3px 0 var(--rr-accent); }

/* history / audit list */
.history { list-style: none; margin: 0; padding: 0; }
.history li { display: grid; grid-template-columns: 150px 160px 1fr; gap: var(--rr-space-4); padding: 10px 0; border-bottom: 1px solid var(--rr-line); font-size: 13px; }
.history del { color: var(--rr-bad-text); }
.history ins { color: var(--rr-ok-text); text-decoration: none; font-weight: 600; }

/* confirm page (deletes, merges) */
.confirm { max-width: 640px; }
.confirm__text { font-size: var(--rr-fs-md); }

/* empty state */
.empty { padding: var(--rr-space-6); text-align: center; color: var(--rr-text-dim); }

/* JS-enhanced popovers: register.js sets this class and fixed coordinates on panels inside a scroll frame */
.pop__panel.is-fixed { position: fixed; }
.flash__close[hidden] { display: none; }

/* boolean flags as text pills (risk detail): ✕ label when true, dashed when false — readable without colour */
.flags { display: flex; flex-wrap: wrap; gap: 6px; }
.flag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--rr-line-strong); font-size: var(--rr-fs-sm); font-weight: 600; background: var(--rr-surface); }
.flag--on { background: var(--rr-eni-black); border-color: var(--rr-eni-black); color: var(--rr-white); }
.flag--on::before { content: "✕"; }
.flag--off { color: var(--rr-text-dim); border-style: dashed; font-weight: 400; }

/* two-column page bodies */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--rr-space-5); align-items: start; }
.admin-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--rr-space-5); align-items: start; }
.stack > * + * { margin-top: var(--rr-space-4); }

/* admin side navigation */
.side-nav { display: flex; flex-direction: column; gap: 2px; padding: 8px; }
.side-nav a { padding: 8px 12px; border-radius: var(--rr-radius); color: var(--rr-text); text-decoration: none; font-weight: 600; font-size: 13px; }
.side-nav a:hover { background: var(--rr-surface-head); }
.side-nav a[aria-current="page"] { background: var(--rr-accent-tint); box-shadow: inset 3px 0 0 var(--rr-accent); }
.side-nav h3 { margin: 12px 12px 4px; font-family: var(--rr-font); font-size: var(--rr-fs-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--rr-text-dim); }
.token-input:focus-within { border-color: var(--rr-eni-black); box-shadow: var(--rr-inset), var(--rr-ring); outline: 2px solid transparent; }

/* meta-list variants */
.meta--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.meta .meta__plain { font-weight: 400; }

/* check-group with a HOLD toggle per item (T-007): one item per row, HOLD on the right */
.check-group--hold { display: grid; grid-template-columns: 1fr; gap: 0; padding: 4px 10px; }
.check-group--hold .check-item { display: flex; align-items: center; gap: var(--rr-space-3); min-height: 30px; border-bottom: 1px solid var(--rr-line); }
.check-group--hold .check-item:last-child { border-bottom: 0; }
.check-group--hold .check-item .hold-toggle { margin-left: auto; }
.check:has(input:disabled) { color: var(--rr-text-dim); }

/* risk form (T-024 pages) */
.sticky-actions { position: sticky; bottom: 0; z-index: 10; }
.eq-edit td { vertical-align: middle; }
.eq-edit .input { width: 4.5em; }
.page > .card + .card, .page > .card + .table-card, .page > .table-card + .card { margin-top: var(--rr-space-4); }

/* risk matrix (S4.5, S5.7; templates/components/risk-matrix.php). Cell colour = risk level, by css_key like .risk-chip.
   The cell text (code, count) uses the level's ink token, so every level keeps ≥ 4.5:1. */
.risk-matrix { display: inline-block; margin: 0; }
.risk-matrix__caption { font-family: var(--rr-font-display); font-weight: 600; font-size: var(--rr-fs-lg); margin-bottom: var(--rr-space-2); }
.matrix { border-collapse: separate; border-spacing: 4px; }
.matrix__corner { width: 96px; padding: 4px; vertical-align: bottom; text-align: left; font-size: var(--rr-fs-xs); font-weight: 600; color: var(--rr-text-dim); line-height: 1.3; }
.matrix__axis { display: block; }
.matrix__axis--cols { text-align: right; }
.matrix__head { padding: 2px 4px; font-size: var(--rr-fs-sm); font-weight: 600; text-align: center; color: var(--rr-text); }
.matrix__head--row { text-align: right; padding-right: 8px; }
.matrix__label { display: block; font-weight: 400; font-size: var(--rr-fs-xs); color: var(--rr-text-dim); max-width: 120px; margin: 0 auto; }
.matrix__head--row .matrix__label { margin: 0 0 0 auto; }
.matrix__cell { width: 72px; height: 64px; padding: 0; border-radius: var(--rr-radius-sm); text-align: center; vertical-align: middle; border: 1px solid rgba(34, 34, 34, 0.18); }
.matrix__cell > a, .matrix__cell > .matrix__in { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 100%; color: inherit; text-decoration: none; border-radius: var(--rr-radius-sm); }
.matrix__cell > a:hover { box-shadow: inset 0 0 0 2px currentColor; }
.matrix__code { font-family: var(--rr-font-mono); font-size: var(--rr-fs-xs); }
.matrix__count { font-family: var(--rr-font-mono); font-size: 22px; font-weight: 600; line-height: 1.1; }
.matrix__cell.is-empty .matrix__count { font-weight: 400; font-size: var(--rr-fs-md); } /* no opacity: the ink colour must keep 4.5:1 on every level */
.matrix__cell.is-selected { outline: 3px solid var(--rr-eni-black); outline-offset: 1px; }
.risk-cell--low       { background: var(--rr-risk-low);       color: var(--rr-risk-low-ink); }
.risk-cell--medium    { background: var(--rr-risk-medium);    color: var(--rr-risk-medium-ink); }
.risk-cell--high      { background: var(--rr-risk-high);      color: var(--rr-risk-high-ink); }
.risk-cell--very-high { background: var(--rr-risk-very-high); color: var(--rr-risk-very-high-ink); }
.risk-cell--none      { background: var(--rr-surface-alt);    color: var(--rr-text); border-style: dashed; border-color: var(--rr-line-strong); }
.risk-matrix__foot { display: flex; flex-wrap: wrap; gap: var(--rr-space-4); margin-top: var(--rr-space-2); font-size: var(--rr-fs-sm); color: var(--rr-text-dim); }
.risk-matrix__legend { display: flex; flex-wrap: wrap; gap: var(--rr-space-2) var(--rr-space-4); margin: var(--rr-space-2) 0 0; padding: 0; list-style: none; font-size: var(--rr-fs-sm); }
.risk-matrix__legend li { display: inline-flex; align-items: center; gap: 6px; }
.matrix__swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(34, 34, 34, 0.25); }
.risk-matrix--compact .matrix { border-spacing: 2px; }
.risk-matrix--compact .matrix__cell { width: 36px; height: 30px; }
.risk-matrix--compact .matrix__count { font-size: var(--rr-fs); }
.risk-matrix--compact .matrix__code, .risk-matrix--compact .matrix__label { display: none; }
.risk-matrix--compact .matrix__corner { width: auto; font-size: 10px; }
@media print { .risk-matrix .matrix__cell, .matrix__swatch { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
