/* Console Kerno v2 : feuille unique, sans dépendance. Méthode adaptée de unslop (Damir Sokolovsky,
   CC BY 4.0, https://github.com/heydamir/unslop). Décor neutre teinté encre, bleu pour agir, vert
   réservé à ce qui est vivant. Contrastes vérifiés : texte ≥ 4.5:1, bordures de champs et
   graphiques ≥ 3:1, dans les deux thèmes. Aucun style en ligne (CSP style-src 'self'). */

:root {
  --page: #f5f7fa;
  --side: #fbfcfd;
  --card: #ffffff;
  --raised: #eceff4;
  --line: rgb(10 22 64 / 0.09);
  --line2: rgb(10 22 64 / 0.16);
  --field: #808aa1;
  --text: #0a1640;
  --sec: #4a5578;
  --mute: #5f6a88;
  --accent: #0b2e8c;
  --accent-soft: #eaf0fc;
  --live: #0e9f5d;
  --btn: #0b2e8c;
  --btn-ink: #ffffff;
  --btn-hover: #092570;
  --code: #0b0d14;
  --code-ink: #e6e9f0;
  --code-key: #9db3ec;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --danger-ink: #ffffff;
  --ok: #0b7a47;
  --ok-soft: #e6f6ee;
  --shadow: 0 8px 24px rgb(10 22 64 / 0.08);
  --shadow-s: 0 1px 2px rgb(10 22 64 / 0.04);
  --focus: #0b2e8c;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --tight: "Inter Tight", "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #0b0d14;
    --side: #08090e;
    --card: #11141c;
    --raised: #1a1e28;
    --line: rgb(238 240 245 / 0.08);
    --line2: rgb(238 240 245 / 0.15);
    --field: #6b7386;
    --text: #eef0f5;
    --sec: #a3a9b8;
    --mute: #8a91a3;
    --accent: #9db3ec;
    --accent-soft: rgb(157 179 236 / 0.14);
    --live: #5cff8a;
    --btn: #eef0f5;
    --btn-ink: #0b0d14;
    --btn-hover: #ffffff;
    --code: #07080d;
    --danger: #ff8a80;
    --danger-soft: rgb(255 138 128 / 0.12);
    --danger-ink: #1c0a09;
    --ok: #5cff8a;
    --ok-soft: rgb(92 255 138 / 0.1);
    --shadow: none;
    --shadow-s: none;
    --focus: #9db3ec;
  }
}

/* ---- base */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 400 14px / 20px var(--sans);
  -webkit-font-smoothing: antialiased;
}
p,
h1,
h2,
h3,
dl,
dd,
figure {
  margin: 0;
}
h2 {
  font-size: 15px;
  line-height: 1.3;
  font-weight: 500;
}
b,
strong {
  font-weight: 600;
}
a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}
code,
.mono {
  font-family: var(--mono);
  font-size: 12.5px;
}
code {
  overflow-wrap: anywhere;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
[hidden] {
  /* biome-ignore lint/complexity/noImportantStyles: l'attribut hidden l'emporte sur l'affichage des composants */
  display: none !important;
}
.num {
  font-variant-numeric: tabular-nums;
}
.sec {
  color: var(--sec);
}
.muted,
.hint {
  color: var(--mute);
}
.hint {
  font-size: 13px;
  line-height: 18px;
}
.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;
}
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
}
.skip:focus {
  left: 16px;
  top: 12px;
  z-index: 50;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.loading {
  padding: 32px;
  color: var(--mute);
}
svg.i {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.logo {
  display: block;
  height: 14px;
  width: auto;
  color: var(--text);
}
.logo .pt {
  fill: var(--live);
}
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  flex: none;
  margin: -2px 8px 0 0;
  vertical-align: middle;
  background: var(--field);
}
.dot.live {
  background: var(--live);
}

/* ---- coquille */
.shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  grid-template-areas: "side main" "side foot";
  min-height: 100vh;
}
.side {
  grid-area: side;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: var(--side);
  border-right: 1px solid var(--line);
}
.topbar {
  display: none;
  align-items: center;
  gap: 12px;
  height: 52px;
  padding: 0 16px;
}
.topbar .org-now {
  margin-left: auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  color: var(--sec);
}
.side-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px 12px 16px;
}
.side-panel > .logo-link {
  padding: 4px 8px;
}
.logo-link {
  display: block;
  width: max-content;
  border-radius: 4px;
  color: var(--text);
}
main#main {
  grid-area: main;
  min-width: 0;
  padding: 28px 32px 36px;
  container: main / inline-size;
}
main#main:focus {
  outline: none;
}
.content {
  max-width: 1120px;
}
.site-footer {
  grid-area: foot;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
  padding: 16px 32px 28px;
  font-size: 13px;
  line-height: 18px;
  color: var(--mute);
}
.site-footer a,
.site-footer .btn.link {
  color: var(--mute);
  text-decoration-color: var(--line2);
}
.site-footer a:hover,
.site-footer .btn.link:hover {
  color: var(--text);
  text-decoration-color: currentColor;
}

/* sélecteur d'espace */
.org {
  position: relative;
}
.org > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 8px;
  border: 1px solid var(--line2);
  border-radius: 10px;
  background: var(--card);
  cursor: pointer;
  list-style: none;
  font-weight: 500;
}
.org > summary::-webkit-details-marker {
  display: none;
}
.org > summary .nm {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.org > summary svg {
  color: var(--mute);
}
.org-menu {
  position: absolute;
  z-index: 20;
  top: 44px;
  left: 0;
  right: 0;
  padding: 6px;
  background: var(--card);
  border: 1px solid var(--line2);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgb(10 22 64 / 0.12);
}
.org-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.org-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 0 8px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
}
.org-menu a:hover {
  background: var(--raised);
}
.org-menu a .nm {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.org-menu .sep {
  height: 1px;
  margin: 6px 0;
  background: var(--line);
}
.av {
  display: grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--raised);
  color: var(--sec);
  font-size: 12px;
  font-weight: 500;
}
.av.lg {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 13px;
}
.av.round {
  border-radius: 50%;
}

/* navigation */
.nav ul {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 8px;
  border-radius: 8px;
  color: var(--sec);
  font-weight: 500;
  text-decoration: none;
}
.nav a svg {
  color: var(--mute);
}
.nav a:hover {
  background: var(--raised);
  color: var(--text);
}
.nav a[aria-current="page"] {
  background: var(--raised);
  color: var(--text);
}
.nav a[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--accent);
}
.nav a[aria-current="page"] svg {
  color: var(--text);
}
.nav .n {
  margin-left: auto;
  font: 12px var(--mono);
  color: var(--mute);
}
.navh {
  padding: 20px 8px 6px;
  font-size: 12px;
  color: var(--mute);
}
.me {
  margin-top: auto;
  display: grid;
  gap: 4px;
  padding: 8px 8px 0;
  border-top: 1px solid var(--line);
}
.me .who {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding-top: 8px;
  font-size: 13px;
  color: var(--sec);
}
.me .who span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.me .btn {
  justify-content: flex-start;
  padding: 0 8px;
}

/* ---- en-tête de page */
.head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.head h1 {
  font: 500 24px / 1.2 var(--tight);
  letter-spacing: -0.01em;
}
.head h1:focus {
  outline: none;
}
.head .sub {
  margin-top: 4px;
  color: var(--sec);
}
.head .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---- boutons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: none;
  height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn.primary {
  background: var(--btn);
  color: var(--btn-ink);
}
.btn.primary:hover:not(:disabled) {
  background: var(--btn-hover);
}
.btn.secondary {
  background: var(--card);
  border-color: var(--line2);
}
.btn.secondary:hover:not(:disabled),
.btn.ghost:hover:not(:disabled),
.btn.icon:hover:not(:disabled) {
  background: var(--raised);
}
.btn.ghost {
  padding: 0 10px;
  color: var(--sec);
}
.btn.danger {
  background: var(--danger);
  color: var(--danger-ink);
}
.btn.danger-ghost {
  color: var(--danger);
  padding: 0 10px;
}
.btn.danger-ghost:hover {
  background: var(--danger-soft);
}
.btn.icon {
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--mute);
}
.btn.sm {
  height: 30px;
  padding: 0 10px;
  font-size: 13px;
}
.btn.block {
  width: 100%;
}
.btn.link {
  height: auto;
  padding: 0;
  border: 0;
  color: var(--accent);
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---- champs */
.field {
  display: grid;
  gap: 6px;
  margin-bottom: 20px;
}
.field > label,
.label {
  font-weight: 500;
}
.field:last-child {
  margin-bottom: 0;
}
input:not([type="checkbox"], [type="radio"]),
select,
textarea {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--field);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
}
textarea {
  height: auto;
  min-height: 80px;
  padding: 10px 12px;
  resize: vertical;
}
input::placeholder,
textarea::placeholder {
  color: var(--mute);
  opacity: 1;
}
input:not([type="checkbox"], [type="radio"]):focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
input[readonly] {
  background: var(--raised);
  color: var(--sec);
}
input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: none;
  accent-color: var(--accent);
}
.with-icon {
  position: relative;
}
.with-icon svg {
  position: absolute;
  left: 12px;
  top: 12px;
  color: var(--mute);
  pointer-events: none;
}
.with-icon input {
  padding-left: 36px;
}
.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  cursor: pointer;
}
.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.row.spread {
  justify-content: space-between;
}
.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
}
.inline-form .field {
  flex: 1 1 180px;
  margin: 0;
}

/* segments (radios) : l'entrée couvre le libellé, son état s'affiche sur le span voisin */
.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  max-width: 100%;
  padding: 3px;
  border-radius: 10px;
  background: var(--raised);
}
.seg label {
  position: relative;
  display: flex;
}
.seg input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.seg span {
  display: flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 7px;
  color: var(--sec);
  font-weight: 500;
  white-space: nowrap;
}
.seg input:checked + span {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--field);
}
.seg input:focus-visible + span {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

/* choix (radios en cartes) */
.choices {
  display: grid;
  gap: 8px;
}
.choice {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line2);
  border-radius: 10px;
  background: var(--card);
  cursor: pointer;
}
.choice input {
  margin-top: 1px;
}
.choice:has(input:checked) {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.choice b,
.choice .d {
  display: block;
}
.choice b {
  font-weight: 500;
}
.choice .d {
  font-size: 13px;
  color: var(--sec);
}

/* interrupteur : l'entrée couvre la ligne entière */
.switch {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.switch input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.switch .sw {
  position: relative;
  width: 36px;
  height: 22px;
  border: 1px solid var(--field);
  border-radius: 11px;
  background: var(--raised);
}
.switch .sw::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--field);
  transition: transform 0.15s ease;
}
.switch input:checked + .sw {
  border-color: var(--accent);
  background: var(--accent);
}
.switch input:checked + .sw::after {
  transform: translateX(14px);
  background: var(--card);
}
.switch input:focus-visible + .sw {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.switch b {
  display: block;
  font-weight: 500;
}
.switch .d {
  display: block;
  font-size: 13px;
  line-height: 18px;
  color: var(--mute);
}
.stack-16 {
  display: grid;
  gap: 16px;
}

/* options avancées */
details.more {
  margin: 4px 0 0;
}
details.more > summary {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 8px;
  padding: 4px 0;
  border-radius: 6px;
  color: var(--sec);
  cursor: pointer;
  list-style: none;
}
details.more > summary::-webkit-details-marker {
  display: none;
}
details.more > summary svg {
  margin-top: 2px;
  color: var(--mute);
  transform: rotate(-90deg);
  transition: transform 0.15s ease;
}
details.more[open] > summary svg {
  transform: none;
}
details.more > summary b {
  display: block;
  font-weight: 500;
}
details.more > summary .d {
  display: block;
  font-size: 13px;
  line-height: 18px;
  color: var(--mute);
}
details.more > .more-b {
  padding: 16px 0 0 24px;
}

/* ---- cartes, listes, tableaux */
.card {
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-s);
}
.card + .card,
.card + .with-sheet,
.with-sheet + .card,
.notice + .card {
  margin-top: 20px;
}
.card-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  min-height: 52px;
  padding: 8px 20px;
  border-bottom: 1px solid var(--line);
}
.card-h h2 {
  font-size: 14px;
  font-weight: 500;
}
.card-h .btn.ghost {
  margin-right: -10px;
}
.card-b {
  padding: 20px;
}
.card-b > p + p,
.card-b > p + .row,
.card-b > .row + p {
  margin-top: 12px;
}
.card.danger-zone {
  border-color: var(--danger);
}
.card.result {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.empty {
  display: grid;
  justify-items: start;
  gap: 12px;
  padding: 24px 20px;
  color: var(--sec);
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.grid-3 + .card,
.grid-3 + .grid-2,
.grid-2 + .card,
.grid-2 + .grid-2 {
  margin-top: 20px;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  align-items: start;
}
.stat {
  padding: 20px;
}
.stat .big {
  display: block;
  margin: 6px 0 2px;
  font: 500 28px / 1.15 var(--tight);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.table-wrap {
  overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th {
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--mute);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table th:first-child,
.table td:first-child {
  padding-left: 20px;
}
.table th:last-child,
.table td:last-child {
  padding-right: 20px;
}
.table tr:last-child td {
  border-bottom: 0;
}
.table .sub {
  display: block;
  margin-top: 2px;
  color: var(--mute);
  font: 12px / 16px var(--mono);
}
.table .act {
  width: 52px;
  text-align: right;
}
.table .when {
  color: var(--sec);
  white-space: nowrap;
}
.table .nm {
  font-weight: 500;
  overflow-wrap: anywhere;
}
.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  margin-left: 6px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--raised);
  color: var(--sec);
  font: 12px var(--mono);
  vertical-align: middle;
  white-space: nowrap;
}
.tag.warn {
  background: var(--danger-soft);
  color: var(--danger);
}
.list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.list > li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 16px;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}
.list > li:last-child {
  border-bottom: 0;
}
.list .meta {
  margin-top: 2px;
  font-size: 13px;
  line-height: 18px;
  color: var(--mute);
}
.list .st {
  font-size: 13px;
  color: var(--sec);
  white-space: nowrap;
}
.list .end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 12px;
}
.person {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.person > div {
  min-width: 0;
}
.person .em {
  overflow-wrap: anywhere;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 28px;
  padding: 0 4px 0 10px;
  border-radius: 14px;
  background: var(--raised);
  color: var(--sec);
  font-size: 13px;
}
.chip.ro {
  padding-right: 10px;
}
.chip .btn.icon {
  width: 24px;
  height: 24px;
  border-radius: 12px;
}
.facts {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 8px 12px;
}
.facts dt {
  color: var(--mute);
}
.facts dd {
  overflow-wrap: anywhere;
}
.facts + .foot,
.facts + .confirm-zone {
  margin-top: 20px;
}

/* ---- panneau latéral */
.with-sheet {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.with-sheet.open {
  grid-template-columns: minmax(0, 1fr) 340px;
}
.sheet {
  min-width: 0;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.sheet-h {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.sheet-h h2 {
  font: 500 17px / 1.3 var(--tight);
}
.sheet-h .btn.icon {
  margin: -6px -8px 0 0;
}
.sheet .sub {
  margin: 2px 0 20px;
  color: var(--sec);
}
.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.sentence {
  padding: 12px;
  border-radius: 10px;
  background: var(--raised);
  color: var(--sec);
}
.sentence b {
  color: var(--text);
  font-weight: 500;
}
.scope-row {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.scope-row + .scope-row {
  margin-top: 8px;
}

/* ---- messages et secrets */
.notice {
  margin: 0 0 16px;
  padding: 10px 14px;
  border: 1px solid var(--line2);
  border-radius: 10px;
  background: var(--raised);
}
.notice.ok {
  border-color: var(--ok);
  background: var(--ok-soft);
}
.notice.error {
  border-color: var(--danger);
  background: var(--danger-soft);
}
.sheet .notice,
.card-b .notice,
.auth-card .notice {
  margin: 16px 0 0;
}
.secret {
  display: block;
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--raised);
  font: 13px / 20px var(--mono);
  word-break: break-all;
  user-select: all;
}
.code {
  margin: 12px 0 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--code);
  color: var(--code-ink);
  font: 12.5px / 20px var(--mono);
  white-space: pre-wrap;
  word-break: break-all;
}
.code .k {
  color: var(--code-key);
}
.status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 12px 12px 12px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--page);
}
.status > span:first-child {
  flex: 1;
  min-width: 200px;
}
.status .btn {
  margin-left: auto;
}

/* ---- connexion */
.auth-shell {
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 100vh;
}
main#main.auth {
  display: grid;
  place-items: center;
  padding: 40px 16px;
}
.auth-card {
  width: min(100%, 380px);
  padding: 28px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.auth-card h1 {
  margin: 24px 0 4px;
  font: 500 22px / 1.25 var(--tight);
}
.auth-card h1:focus {
  outline: none;
}
.auth-card .lede {
  margin-bottom: 24px;
  color: var(--sec);
}
.auth-card .hint {
  margin-top: 20px;
}
.auth-card .legal {
  margin-top: 8px;
}
.stack {
  display: grid;
  gap: 8px;
}
.or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
  font-size: 13px;
  color: var(--mute);
}
.or::before,
.or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.auth-shell .site-footer {
  grid-area: auto;
  justify-content: center;
  padding: 0 16px 28px;
}

/* ---- premier pas */
.start {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.steps {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.steps li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 12px;
  padding: 10px;
  border-radius: 10px;
}
.steps li b {
  display: block;
  font-weight: 500;
}
.steps li .d {
  display: block;
  font-size: 13px;
  line-height: 18px;
  color: var(--mute);
}
.steps .ic {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--field);
  border-radius: 50%;
  color: var(--mute);
  font-size: 12px;
  font-weight: 500;
}
.steps .ic svg {
  width: 12px;
  height: 12px;
}
.steps .done .ic {
  border-color: transparent;
  background: var(--raised);
  color: var(--sec);
}
.steps .now {
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
}
.steps .now .ic {
  border-color: var(--accent);
  color: var(--accent);
}
.steps a {
  color: inherit;
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0 20px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
}
.tab {
  margin-bottom: -1px;
  padding: 14px 0 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--sec);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}
.tab[aria-selected="true"] {
  border-bottom-color: var(--text);
  color: var(--text);
}
.tab:focus-visible {
  outline-offset: -2px;
}
.tabpanel > p:first-child {
  margin-bottom: 4px;
}
.tabpanel .row {
  margin-top: 12px;
}

/* ---- facturation */
.bill {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}
.col {
  display: grid;
  gap: 20px;
  min-width: 0;
}
.figure {
  padding: 20px;
}
.figure .big {
  display: block;
  margin: 6px 0 2px;
  font: 500 40px / 1.1 var(--tight);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.bar {
  position: relative;
  height: 8px;
  margin: 16px 0 10px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--raised);
  box-shadow: inset 0 0 0 1px var(--line2);
}
.bar > span {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 4px;
  background: var(--accent);
}
.bar.full > span {
  background: var(--danger);
}
.chart {
  padding: 20px;
}
.chart .top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.chart .top h2 {
  font-size: 14px;
  font-weight: 500;
}
.plot {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 8px;
  height: 160px;
}
.yax {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin: -5px 0;
  font: 11px / 1 var(--mono);
  color: var(--mute);
  text-align: right;
}
.bars {
  display: block;
  width: 100%;
  height: 100%;
}
.bars line {
  stroke: var(--line2);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.bars rect {
  fill: var(--field);
}
.bars rect.today {
  fill: var(--accent);
}
.xax {
  display: flex;
  justify-content: space-between;
  margin: 8px 0 0 52px;
  font: 11px var(--mono);
  color: var(--mute);
}
.rows > div {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
}
.rows > div:last-child {
  border-bottom: 0;
}
.rows > div > span:last-child {
  text-align: right;
  white-space: nowrap;
}
.rows .d {
  display: block;
  font-size: 13px;
  line-height: 18px;
  color: var(--mute);
}
.rows .tot {
  font-weight: 500;
}
.capv {
  font: 500 22px / 1.2 var(--tight);
  font-variant-numeric: tabular-nums;
}
.capv span {
  font: 14px var(--sans);
  color: var(--sec);
}

/* ---- compléments de pages : colonnes, pieds de carte, formulaires en ligne */
.col > .card,
.col > details.more,
.grid-2 > .card,
.grid-3 > .card {
  margin-top: 0;
}
.stack-16 > div:empty {
  display: none;
}
.stack-16 > .field {
  margin-bottom: 0;
}
.inline-form .btn {
  height: 40px;
}
details.more + .sentence {
  margin-top: 16px;
}
/* Un chemin court passe à la ligne d'un bloc plutôt que de se couper à son tiret. */
.sentence code,
.list p code {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.result-h {
  margin-bottom: 4px;
  font: 500 17px / 1.3 var(--tight);
}
.stat-h {
  font-size: 14px;
  font-weight: 400;
  color: var(--sec);
}
.card-intro {
  margin-bottom: 16px;
}
.card > .card-intro {
  margin: 0;
  padding: 14px 20px 2px;
}
.card-foot {
  padding: 16px 20px;
  border-top: 1px solid var(--line);
}
.card-sep {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.field-after {
  margin-top: 8px;
}
.inline-form > div:not(.field) {
  flex: 1 0 100%;
}
.inline-form > div:not(.field):empty {
  display: none;
}
.inline-form .notice {
  margin: 8px 0 0;
}
.meta.block,
.scope-line {
  display: block;
}
.scope-rows {
  margin-top: 12px;
}
.add-row {
  margin-top: 8px;
}
.table-foot {
  padding: 12px 20px;
  border-top: 1px solid var(--line);
}
.table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.status-wrap {
  padding-top: 0;
}
.status-wrap .status {
  margin-top: 0;
}
select.role,
select.add-member {
  width: auto;
  max-width: min(100%, 240px);
  height: 34px;
}
.journal,
details.more + .card {
  margin-top: 20px;
}
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.filter-grid .field {
  margin: 0;
}
.pager {
  justify-content: center;
  margin-top: 16px;
}
.explain:not(:empty) {
  margin-top: 16px;
}
.trace {
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--sec);
  font-size: 13px;
  line-height: 20px;
}
.trace li + li {
  margin-top: 4px;
}
.facts.txt {
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 12px;
  margin-top: 8px;
  font-size: 13px;
}

/* ---- partages */
.invite {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-bottom: 20px;
  padding: 14px 16px 14px 20px;
}
.invite > p {
  flex: 1 1 240px;
  min-width: 0;
}
.invite .row {
  margin-left: auto;
}

/* ---- consentement à la mesure d'audience (choix à égalité) */
.consent {
  position: fixed;
  z-index: 30;
  inset: auto 16px 16px 16px;
  max-width: 40rem;
  margin: 0 auto;
  padding: 16px 20px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line2);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgb(10 22 64 / 0.16);
}
.consent h2 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 500;
}
.consent p {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 18px;
  color: var(--sec);
}
.consent .actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ---- adaptations */
@container main (max-width: 760px) {
  .with-sheet.open,
  .bill,
  .start {
    grid-template-columns: minmax(0, 1fr);
  }
  .with-sheet .sheet {
    order: -1;
  }
}
@container main (max-width: 560px) {
  .head {
    flex-wrap: wrap;
  }
  .head h1 {
    font-size: 22px;
  }
  .table .hide-s {
    display: none;
  }
  .table th,
  .table td {
    padding-left: 12px;
    padding-right: 12px;
  }
  .table th:first-child,
  .table td:first-child {
    padding-left: 16px;
  }
  .table th:last-child,
  .table td:last-child {
    padding-right: 16px;
  }
  .list > li {
    padding: 14px 16px;
  }
  .list > li.wrap-s {
    grid-template-columns: minmax(0, 1fr);
  }
  .list > li.wrap-s .end {
    justify-content: flex-start;
  }
  .tabs {
    gap: 0 16px;
    padding: 0 16px;
  }
  .card-h,
  .rows > div,
  .card-foot,
  .card > .card-intro,
  .table-foot {
    padding-left: 16px;
    padding-right: 16px;
  }
  .card-b,
  .chart,
  .figure,
  .stat {
    padding: 16px;
  }
  .invite {
    padding: 16px;
  }
  .invite .row {
    margin-left: 0;
  }
  .facts {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
  .facts dd + dt {
    margin-top: 8px;
  }
}
@media (max-width: 760px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr auto;
    grid-template-areas: "side" "main" "foot";
  }
  .side {
    position: static;
    height: auto;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .topbar {
    display: flex;
  }
  .side-panel {
    display: none;
    padding: 4px 12px 16px;
  }
  .side.open .side-panel {
    display: flex;
  }
  .side-panel > .logo-link {
    display: none;
  }
  main#main {
    padding: 20px 16px 28px;
  }
  .site-footer {
    padding: 8px 16px 24px;
  }
  /* 16 px : évite le zoom automatique d'iOS sur les champs */
  input:not([type="checkbox"], [type="radio"]),
  select,
  textarea {
    font-size: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    /* biome-ignore lint/complexity/noImportantStyles: préférence de l'utilisateur, prioritaire sur toute transition */
    transition: none !important;
  }
}
