/* SPS-CARBON base: reset, type, controls, status, gauge, tables. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  background: var(--bg); color: var(--label);
  font: 400 var(--t-body)/1.5 var(--font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: default; }
table { border-collapse: collapse; width: 100%; }
::selection { background: var(--accent-soft); }

/* Page titles in Archivo, as on the website (one SPS style, 30 Nov 2026), a little narrower than the site's. */
h1 { font-family: var(--font-display); font-size: var(--t-large); font-weight: 660; font-stretch: 104%; line-height: 1.1; letter-spacing: -0.025em; text-wrap: balance; }
h2 { font-size: var(--t-title-2); font-weight: 620; line-height: 1.3; letter-spacing: -0.01em; }
h3 { font-size: var(--t-body); font-weight: 600; line-height: 1.35; }
.lead { color: var(--label-2); font-size: var(--t-body); max-width: 70ch; margin-top: 0.35rem; text-wrap: pretty; }
.muted { color: var(--label-2); }
.small { font-size: var(--t-foot); }
.warn-text { color: var(--orange); font-weight: 560; }
.ok-text { display: flex; align-items: center; gap: 0.4rem; color: var(--accent-text); font-weight: 560; }
.c-danger { color: var(--red); }
.c-check { color: var(--orange); }
.num, td.num, th.num { text-align: right; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
code, kbd { font: 500 0.85em var(--font); padding: 0.1em 0.4em; border-radius: 5px; background: var(--fill-2); color: var(--label-2); }
kbd { border: 0.5px solid var(--sep-2); box-shadow: 0 0.5px 0 var(--sep-2); }

/* index.html opened from the folder (file://): the guide shown by boot.js */
.boot-file { max-width: 34rem; margin: 12vh auto 0; padding: 2rem 2.1rem; border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--card-shadow); }
.boot-file h1 { font-size: var(--t-title); }
.boot-file p { margin-top: 0.6rem; color: var(--label-2); }
.boot-file ol { margin-top: 1.1rem; display: grid; gap: 0.55rem; counter-reset: step; }
.boot-file li { position: relative; padding-left: 2.1rem; counter-increment: step; }
.boot-file li::before { content: counter(step); position: absolute; left: 0; top: -0.05rem; display: grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: var(--t-foot); font-weight: 650; }

:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 1px; border-radius: 6px; }
h1[tabindex="-1"]:focus { outline: none; }

/* Icons: the SPS-CARBON family (strokes and a soft tint, see app/ui/icons.js) */
/* The SPS icons are strokes (icons.js): one line weight on screen whatever the icon's size
 * (1.3 px; 1.5 px on a tile), as a type family keeps one stroke across its sizes. Sizes come
 * from one scale: 12, 14, 16, 18, 20, 24 px. */
.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.3px; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.i :is(path, circle, rect, ellipse, line, polyline, polygon) { vector-effect: non-scaling-stroke; }
.i-fill { stroke-width: 1.5px; }
/* Duotone in one ink: key shapes carry a soft tint of the same colour, a
 * little deeper when the control is pointed at or is the page you are on. */
.i .t { fill: currentColor; fill-opacity: 0.12; transition: fill-opacity var(--m-150, 150ms) ease-out; }
:is(a, button, .is-active):is(:hover, :focus-visible, .is-active) > .i .t,
:is(a, button):is(:hover, :focus-visible) .side-ic .i .t, .side-item.is-active .i .t { fill-opacity: 0.22; }
.i-fill .t { fill-opacity: 0.24; }

/* ---------- Buttons (macOS: compact, 6–8px radius, quiet bezel) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  height: 34px; padding: 0 1rem;
  border: 0; border-radius: 999px;
  background: var(--surface); color: var(--label);
  box-shadow: inset 0 0 0 1px var(--sep-2);
  font-size: var(--t-callout); font-weight: 550; white-space: nowrap;
  transition: background var(--m-100) var(--ease), opacity var(--m-100) var(--ease), box-shadow var(--m-100) var(--ease), transform var(--m-100) var(--ease);
}
.btn:hover { background: var(--surface-2); }
.btn:active { opacity: 0.8; transform: scale(0.975); }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.btn .i { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger { background: var(--red); color: #fff; box-shadow: none; }
.btn-danger:hover { background: var(--red); opacity: 0.9; }
.btn-quiet { background: transparent; box-shadow: none; color: var(--label-2); }
.btn-quiet:hover { background: var(--fill-2); color: var(--label); }
.btn-danger-quiet:hover { background: var(--red-soft); color: var(--red); }
.btn-sm { height: 28px; padding: 0 0.75rem; font-size: var(--t-foot); }
.btn-icon { width: 30px; height: 30px; padding: 0; position: relative; border-radius: 999px; }
.btn-icon.is-on { color: var(--accent-text); }
.badge { position: absolute; top: -2px; right: -3px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 8px; background: var(--orange); color: #fff; font-size: 10px; font-weight: 650; line-height: 15px; text-align: center; }

/* ---------- Inputs ---------- */
.field { display: grid; gap: 0.35rem; margin-top: 0.9rem; }
.label { font-size: var(--t-foot); font-weight: 560; color: var(--label-2); }
.input {
  width: 100%; height: 34px; padding: 0 0.7rem;
  border: 0; border-radius: var(--r-s);
  background: var(--surface); color: var(--label);
  box-shadow: inset 0 0 0 1px var(--sep-2);
  font-size: var(--t-callout);
  transition: box-shadow var(--m-150) var(--ease);
}
.input:focus { outline: none; box-shadow: inset 0 0 0 1px var(--accent-text), 0 0 0 3px var(--accent-ring); }
.input::placeholder { color: var(--label-4); }
select.input {
  appearance: none; padding-right: 1.6rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 9.5l4-4 4 4M8 14.5l4 4 4-4'/%3E%3C/svg%3E"); /* the SPS caret, up and down */
  background-repeat: no-repeat; background-position: right 0.4rem center; background-size: 13px;
}
textarea.input { height: auto; min-height: 64px; padding: 0.5rem 0.6rem; resize: vertical; line-height: 1.45; }

/* ---------- Status (website tags) ---------- */
.status { display: inline-flex; align-items: center; gap: 0.35em; padding: 0.2em 0.6em; border-radius: var(--r-xs); font-size: var(--t-cap); font-weight: 620; line-height: 1.4; white-space: nowrap; background: var(--gray-soft); color: var(--label-2); }
.status .i { display: none; }
.status[data-status="soumis"], .status[data-status="en_revue"] { background: var(--orange-soft); color: var(--orange); }
.status[data-status="a_corriger"] { background: var(--red-soft); color: var(--red); }
.status[data-status="valide"] { background: var(--accent-soft); color: var(--accent-text); }
.pill-tag { display: inline-flex; align-items: center; gap: 0.35em; padding: 0.2em 0.6em; border-radius: var(--r-xs); font-size: var(--t-cap); font-weight: 620; line-height: 1.4; font-style: normal; white-space: nowrap; background: var(--gray-soft); color: var(--label-2); }
.pill-tag.ok { background: var(--accent-soft); color: var(--accent-text); }
.pill-tag.wait { background: var(--orange-soft); color: var(--orange); }
.pill-tag.miss { background: var(--red-soft); color: var(--red); }
.pill-tag.info { background: var(--blue-soft); color: var(--blue); }
.tag { color: var(--label-2); font-size: var(--t-foot); font-weight: 500; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.avatar { display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-size: 11px; font-weight: 600; letter-spacing: 0.02em; }
.avatar-s { width: 22px; height: 22px; font-size: 9px; }
.avatar-l { width: 36px; height: 36px; font-size: 13px; }

/* ---------- Reliability gauge (replaces the 0–5 score glyphs) ---------- */
.gauge { display: inline-flex; align-items: center; gap: 0.45rem; white-space: nowrap; font-size: var(--t-foot); color: var(--label-2); }
.gauge-track { position: relative; width: 44px; height: 5px; border-radius: 3px; background: var(--fill); overflow: hidden; }
.gauge-fill { position: absolute; inset: 0; border-radius: 3px; background: var(--g); transform-origin: left; transform: scaleX(var(--v)); transition: transform var(--m-300) var(--ease-out); }
.gauge-s .gauge-track { width: 32px; height: 4px; }
.gauge b { font-weight: 600; color: var(--label); }
.gauge-word { color: var(--label-2); }
.tone-good { --g: var(--good); }
.tone-fair { --g: var(--fair); }
.tone-weak { --g: var(--weak); }
.tone-none { --g: transparent; }

/* ---------- Tables ---------- */
.table { font-size: var(--t-callout); }
.table th, .table td { padding: 0.6rem 0.75rem; border-bottom: 0.5px solid var(--sep); text-align: left; vertical-align: top; }
.table th.num, .table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table thead th { font-size: var(--t-cap); font-weight: 560; color: var(--label-3); border-bottom-color: var(--sep-2); white-space: nowrap; }
.table tbody th { font-weight: 500; }
.table tfoot th, .table tfoot td { border-bottom: 0; border-top: 0.5px solid var(--sep-2); font-weight: 620; }
.table th small { display: block; font-weight: 400; color: var(--label-3); font-size: var(--t-cap); margin-top: 0.1rem; }
.table-dense th, .table-dense td { padding: 0.4rem 0.6rem; font-size: var(--t-foot); }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.zero { color: var(--label-4); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
.skip-link { position: fixed; top: 10px; left: 10px; z-index: 1000; padding: 8px 14px; border-radius: var(--r-s); background: var(--label); color: var(--surface); font-weight: 600; text-decoration: none; transform: translateY(-160%); transition: transform 160ms ease; }
.skip-link:focus-visible { transform: none; }
#page:focus { outline: none; }
