/* ==== Risk Register — base (RR_Design) ================================================================================
   Element defaults, focus ring, small utilities. Needs tokens.css.
   ===================================================================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { min-width: var(--rr-min-width); }
body {
  margin: 0;
  font-family: var(--rr-font);
  font-size: var(--rr-fs);
  line-height: 1.5;
  color: var(--rr-text);
  background: var(--rr-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
::selection { background: var(--rr-accent); color: var(--rr-accent-ink); }
h1, h2, h3, h4 { margin: 0 0 var(--rr-space-3); font-weight: 600; line-height: 1.2; color: var(--rr-text); }
h1, h2 { font-family: var(--rr-font-display); letter-spacing: 0.01em; }
h1 { font-size: var(--rr-fs-xl); }
h2 { font-size: 22px; }
h3 { font-size: var(--rr-fs-md); }
h4 { font-size: var(--rr-fs); }
p { margin: 0 0 var(--rr-space-3); }
a { color: var(--rr-link); text-underline-offset: 2px; }
a:hover { color: var(--rr-link-hover); }
code, kbd, samp { font-family: var(--rr-font-mono); font-size: 0.95em; }
small { font-size: var(--rr-fs-sm); }
hr { border: 0; border-top: 1px solid var(--rr-line); margin: var(--rr-space-4) 0; }
:focus:not(:focus-visible) { outline: none; }
/* Ring = box-shadow; the transparent outline becomes visible in Windows High Contrast / forced colours,
   where box-shadows are removed (WCAG 2.4.7). Components that set their own ring keep this outline. */
:focus-visible { outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--rr-ring); border-radius: var(--rr-radius-sm); }
@media (forced-colors: active) {
  :focus-visible { outline: 2px solid CanvasText; }
  .lang-switch [aria-current="true"], .btn--primary, .badge--hold, .filter-btn--on { forced-color-adjust: none; }
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--rr-eni-black); width: 16px; height: 16px; margin: 0; }
[hidden] { display: none !important; }
* { scrollbar-color: var(--rr-eni-grey-500) transparent; scrollbar-width: thin; }

/* Plain form controls without component classes (pages not yet on templates/components/) look like .input / .btn.
   :where() keeps the specificity at zero, so every component class overrides these. */
:where(input:not([type="checkbox"], [type="radio"], [type="hidden"], [type="submit"], [type="button"], [type="file"]), select, textarea) {
  width: 100%; max-width: 480px; 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);
}
:where(textarea) { height: auto; min-height: 84px; padding: 8px 10px; }
:where(input, select, textarea):focus-visible { border-color: var(--rr-eni-black); box-shadow: var(--rr-inset), var(--rr-ring); border-radius: var(--rr-radius); }
:where(label) { font-weight: 600; font-size: var(--rr-fs-sm); }
:where(form p > label) { display: block; margin-bottom: 4px; }
:where(main button:not([class]), main input[type="submit"]) {
  height: 36px; padding: 0 var(--rr-space-4);
  font: 600 var(--rr-fs)/1 var(--rr-font);
  color: var(--rr-accent-ink); background: var(--rr-accent);
  border: 1px solid var(--rr-accent); border-radius: var(--rr-radius); cursor: pointer;
}
:where(main button:not([class]):hover) { background: var(--rr-accent-hover); }

/* utilities */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--rr-text-dim); }
.mono { font-family: var(--rr-font-mono); }
.num { font-family: var(--rr-font-mono); font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.u-mt-0 { margin-top: 0; } .u-mt-3 { margin-top: var(--rr-space-3); } .u-mt-4 { margin-top: var(--rr-space-4); } .u-mt-5 { margin-top: var(--rr-space-5); }
.u-mb-0 { margin-bottom: 0; } .u-mb-3 { margin-bottom: var(--rr-space-3); } .u-mb-4 { margin-bottom: var(--rr-space-4); } .u-mb-5 { margin-bottom: var(--rr-space-5); }
.u-ml-auto { margin-left: auto; }
.u-flex { display: flex; align-items: center; gap: var(--rr-space-2); flex-wrap: wrap; }
.u-w-full { width: 100%; }
.u-text-right { text-align: right; }
.u-small { font-size: var(--rr-fs-sm); }
/* a <form> around one POST button, inline in table cells and toolbars */
.inline-form { display: inline-flex; align-items: center; gap: var(--rr-space-2); margin: 0; vertical-align: middle; }
.table td .inline-form + .inline-form, .table td .btn + .inline-form, .table td .inline-form + .btn { margin-left: var(--rr-space-1); }
