/* =========================================================================
   AliasIt — feuille de style unique.
   Aucune police distante : charger une font externe ferait fuiter l'adresse IP
   du visiteur, ce qui contredirait la promesse de l'outil.
   ========================================================================= */

/* --------------------------------- jetons -------------------------------- */
:root {
  color-scheme: light;

  --ink:        #141e1c;
  --ink-soft:   #48605c;
  --ink-faint:  #647a76;

  --paper:      #eceff0;
  --surface:    #ffffff;
  --sunk:       #f5f7f7;
  --rule:       #d3dbda;
  --rule-soft:  #e3e9e8;

  --pine:       #0e5245;
  --pine-hi:    #14705e;
  --pine-wash:  #dfeee9;

  --brick:      #9b3b24;
  --brick-wash: #f8e4de;

  --amber:      #9a6a10;
  --amber-wash: #fbeed4;

  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
             "Noto Sans", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", "Cascadia Mono", "Roboto Mono",
               Menlo, Consolas, "Liberation Mono", monospace;

  --t-xs: 0.75rem;
  --t-sm: 0.8125rem;
  --t-base: 0.9375rem;
  --t-md: 1.0625rem;
  --t-lg: 1.3125rem;
  --t-xl: 1.6875rem;
  --t-2xl: 2.125rem;

  --gap: 1.25rem;
  --shell: 1420px;

  /* le rayon encode la hiérarchie : surfaces de travail plates, contrôles
     légèrement adoucis, éléments flottants nettement arrondis */
  --r-sheet: 2px;
  --r-ctrl: 6px;
  --r-float: 12px;

  --lift: 0 1px 2px rgba(20, 30, 28, .06), 0 12px 32px -12px rgba(20, 30, 28, .22);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

[data-theme="dark"] {
  color-scheme: dark;

  --ink:        #e4ecea;
  --ink-soft:   #9bb0ab;
  --ink-faint:  #6c817d;

  --paper:      #0b1312;
  --surface:    #121d1b;
  --sunk:       #0e1817;
  --rule:       #253431;
  --rule-soft:  #1c2927;

  --pine:       #2f9e85;
  --pine-hi:    #44bb9f;
  --pine-wash:  #10312b;

  --brick:      #e08165;
  --brick-wash: #3a1d15;

  --amber:      #e0ac4c;
  --amber-wash: #382a12;

  --lift: 0 1px 2px rgba(0, 0, 0, .5), 0 16px 40px -14px rgba(0, 0, 0, .7);
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    color-scheme: dark;
    --ink: #e4ecea; --ink-soft: #9bb0ab; --ink-faint: #7d938e;
    --paper: #0b1312; --surface: #121d1b; --sunk: #0e1817;
    --rule: #253431; --rule-soft: #1c2927;
    --pine: #2f9e85; --pine-hi: #44bb9f; --pine-wash: #10312b;
    --brick: #e08165; --brick-wash: #3a1d15;
    --amber: #e0ac4c; --amber-wash: #382a12;
    --lift: 0 1px 2px rgba(0,0,0,.5), 0 16px 40px -14px rgba(0,0,0,.7);
  }
}

/* --------------------------------- socle --------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

/* Un `display` explicite l'emporterait sur l'attribut hidden : sans cette règle,
   une modale « fermée » continue d'intercepter les clics. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--t-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.015em; line-height: 1.25; }
p { margin: 0; }
button { font: inherit; color: inherit; }

a { color: var(--pine); text-underline-offset: 2px; }

:focus-visible {
  outline: 2px solid var(--pine);
  outline-offset: 2px;
  border-radius: 3px;
}

.sr {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 50%; top: -100px; transform: translateX(-50%);
  z-index: 100; background: var(--pine); color: #fff; padding: .6rem 1.1rem;
  border-radius: 0 0 var(--r-ctrl) var(--r-ctrl); text-decoration: none;
}
.skip:focus { top: 0; }

/* -------------------------------- topbar --------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.topbar__in {
  max-width: var(--shell); margin: 0 auto;
  padding: .6rem clamp(.85rem, 2.4vw, 1.75rem);
  display: flex; align-items: center; gap: 1rem;
}

.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: inherit; }
.brand__mark { width: 30px; height: 30px; flex: none; }
.brand__mark rect { fill: var(--ink); }
.brand__mark .brand__mark--alt { fill: var(--pine); }
.brand__mark .brand__rule,
.brand__mark .brand__arrow {
  fill: none; stroke: var(--ink-faint); stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}
.brand__name { font-size: var(--t-md); font-weight: 640; letter-spacing: -.02em; }

.topbar__claim {
  flex: 1; min-width: 0;
  font-size: var(--t-sm); color: var(--ink-soft);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.topbar__tools { display: flex; align-items: center; gap: .3rem; }

.netstate {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: var(--t-xs); color: var(--ink-soft);
  padding: .3rem .55rem; border: 1px solid var(--rule); border-radius: 999px;
  margin-right: .35rem; white-space: nowrap;
}
.netstate__dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--pine); flex: none;
}

.icobtn {
  display: inline-flex; align-items: center; gap: .38rem;
  padding: .42rem .6rem; background: transparent;
  border: 1px solid transparent; border-radius: var(--r-ctrl);
  cursor: pointer; font-size: var(--t-sm); color: var(--ink-soft);
  transition: background .15s var(--ease), color .15s var(--ease);
}
.icobtn:hover { background: var(--sunk); color: var(--ink); }
.icobtn svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icobtn[aria-pressed="true"] { background: var(--pine-wash); color: var(--pine); border-color: color-mix(in srgb, var(--pine) 30%, transparent); }
.icobtn--alarm:hover { background: var(--brick-wash); color: var(--brick); }
@media (max-width: 900px) { .icobtn__label { display: none; } .topbar__claim { display: none; } }

/* ------------------------------ plan de travail -------------------------- */
main { max-width: var(--shell); margin: 0 auto; padding: var(--gap) clamp(.85rem, 2.4vw, 1.75rem) 3rem; }

.bench {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--gap);
  align-items: stretch;
}

.pane {
  display: flex; flex-direction: column; min-width: 0;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-sheet);
}
/* la couleur porte l'état : brique = exposé, pin = protégé */
.pane--source { border-top: 3px solid var(--brick); }
.pane--safe   { border-top: 3px solid var(--pine); }

.pane__head {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .7rem .85rem; border-bottom: 1px solid var(--rule-soft);
}
.pane__title { font-size: var(--t-base); font-weight: 620; }
.pane__acts { display: flex; gap: .2rem; flex: none; }

.ghost {
  padding: .3rem .55rem; background: none; border: 1px solid transparent;
  border-radius: var(--r-ctrl); cursor: pointer;
  font-size: var(--t-sm); color: var(--ink-soft);
  transition: background .15s var(--ease), color .15s var(--ease);
}
.ghost:hover { background: var(--sunk); color: var(--ink); }
.ghost--strong { color: var(--pine); border-color: color-mix(in srgb, var(--pine) 35%, transparent); }
.ghost--strong:hover { background: var(--pine-wash); color: var(--pine); }

.linkbtn {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-size: var(--t-sm); color: var(--ink-soft); text-decoration: underline;
  text-underline-offset: 2px;
}
.linkbtn:hover { color: var(--brick); }

/* --- éditeur avec calque de surlignage --- */
.editor { position: relative; flex: 1; min-height: 0; }

/* le calque et la zone de saisie doivent partager exactement les mêmes
   métriques, sinon le surlignage se décale */
.editor__marks,
.editor__area {
  font-family: var(--font-mono);
  font-size: var(--t-base);
  line-height: 1.65;
  letter-spacing: 0;
  padding: .9rem .95rem;
  border: 0;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: normal;
  tab-size: 2;
}

.editor__marks {
  position: absolute; inset: 0;
  overflow: hidden; pointer-events: none;
  color: transparent;
  z-index: 0;
}

.editor__area {
  position: relative; z-index: 1;
  display: block; width: 100%; height: 100%;
  min-height: clamp(230px, 34vh, 420px);
  background: transparent; color: var(--ink);
  resize: vertical; outline-offset: -2px;
}
.editor__area::placeholder { color: var(--ink-faint); font-family: var(--font-ui); }
.editor__area:focus { outline: 2px solid var(--pine); }

.mark {
  border-radius: 2px;
  box-shadow: inset 0 -1px 0 currentColor;
}
.mark--custom { background: var(--pine-wash); color: var(--pine); }
.mark--auto   { background: var(--amber-wash); color: var(--amber); }

.pane__foot {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  padding: .5rem .85rem; border-top: 1px solid var(--rule-soft);
  font-size: var(--t-xs); color: var(--ink-soft);
}
.pane__foot-sep { width: 1px; height: 11px; background: var(--rule); }
.pane__foot b { color: var(--ink); font-weight: 600; }

/* --- verdict de contrôle --- */
.verdict {
  margin: 0 .85rem .85rem; padding: .6rem .7rem;
  border-radius: var(--r-ctrl); font-size: var(--t-sm);
  border: 1px solid;
}
.verdict--ok   { background: var(--pine-wash);  border-color: color-mix(in srgb, var(--pine) 28%, transparent);  color: var(--pine); }
.verdict--warn { background: var(--brick-wash); border-color: color-mix(in srgb, var(--brick) 30%, transparent); color: var(--brick); }
.verdict__list { margin: .4rem 0 0; padding-left: 1.1rem; display: grid; gap: .15rem; }
.verdict__list code { font-family: var(--font-mono); font-size: var(--t-xs); }

/* --- commandes centrales --- */
.switchboard {
  display: flex; flex-direction: column; justify-content: center; gap: .6rem;
  padding: 0 .2rem;
}

.act {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .62rem 1rem;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--rule); border-radius: var(--r-ctrl);
  cursor: pointer; font-size: var(--t-base); font-weight: 560;
  white-space: nowrap;
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .08s var(--ease);
}
.act:hover { background: var(--sunk); border-color: var(--ink-faint); }
.act:active { transform: translateY(1px); }
.act--primary { background: var(--pine); border-color: var(--pine); color: #fff; }
.act--primary:hover { background: var(--pine-hi); border-color: var(--pine-hi); }
.act--sm { padding: .42rem .7rem; font-size: var(--t-sm); }
.act[disabled] { opacity: .45; cursor: not-allowed; }
.act__arrow { font-size: 1.05em; }
.act__key {
  font-family: var(--font-mono); font-size: 10px; opacity: .62;
  border: 1px solid currentColor; border-radius: 3px; padding: 0 .25rem;
}
@media (max-width: 1080px) { .act__key { display: none; } }

/* ---------------------------------- cartes -------------------------------- */
.workshop {
  margin-top: var(--gap);
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: var(--gap);
  align-items: start;
}
/* La table occupe toute la hauteur de la colonne : c'est la zone de travail
   principale, elle mérite la place plutôt que de laisser un vide dessous. */
.card--ledger { grid-row: span 2; align-self: stretch; display: flex; flex-direction: column; }
.card--ledger #ledger-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-sheet);
  padding: 1rem 1.05rem 1.05rem;
}
.card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; margin-bottom: .85rem; }
.card__title { font-size: var(--t-md); }
.card__sub { font-size: var(--t-sm); color: var(--ink-soft); margin-top: .12rem; }
.card__acts { display: flex; gap: .2rem; flex: none; }
.card__split { margin-top: 1.1rem; padding-top: .95rem; border-top: 1px solid var(--rule-soft); }
.card__h3 { font-size: var(--t-sm); color: var(--ink-soft); font-weight: 600; margin-bottom: .55rem; }

.field {
  width: 100%; padding: .42rem .6rem;
  background: var(--sunk); color: var(--ink);
  border: 1px solid var(--rule); border-radius: var(--r-ctrl);
  font: inherit; font-size: var(--t-sm);
}
.field:focus { outline: 2px solid var(--pine); outline-offset: -1px; border-color: var(--pine); }
.field--search { max-width: 240px; }

/* --- la table : un registre relié, pas une grille --- */
.ledger__bar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .6rem; }
.ledger__count { font-size: var(--t-xs); color: var(--ink-faint); white-space: nowrap; }

.ledger__scroll {
  flex: 1; min-height: 180px; max-height: 60vh; overflow: auto;
  border-block: 1px solid var(--rule-soft);
}

.ledger { width: 100%; border-collapse: collapse; }
.ledger thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--surface);
  text-align: left; font-size: var(--t-xs); font-weight: 600; color: var(--ink-faint);
  padding: .45rem .5rem; border-bottom: 1px solid var(--rule);
}
.ledger__th-on { width: 34px; }

.ledger tbody tr { border-bottom: 1px solid var(--rule-soft); }
.ledger tbody tr:last-child { border-bottom: 0; }
.ledger tbody tr.is-off { opacity: .45; }
.ledger tbody tr.is-bad td { background: var(--brick-wash); }
.ledger td { padding: .22rem .3rem; vertical-align: middle; }
.ledger td:first-child { padding-left: .5rem; }

/* le filet vertical qui relie les deux colonnes du registre */
.ledger td.cell--to { position: relative; }
.ledger td.cell--to::before {
  content: ""; position: absolute; left: -.15rem; top: .35rem; bottom: .35rem;
  width: 1px; background: var(--rule);
}

.cellinput {
  width: 100%; padding: .34rem .45rem;
  background: transparent; color: var(--ink);
  border: 1px solid transparent; border-radius: var(--r-ctrl);
  font-family: var(--font-mono); font-size: var(--t-sm);
}
.cellinput:hover { border-color: var(--rule); }
.cellinput:focus { background: var(--sunk); border-color: var(--pine); outline: none; }
.cellinput::placeholder { color: var(--ink-faint); }
.cell--to .cellinput { color: var(--pine); }

.rowdel {
  width: 26px; height: 26px; display: grid; place-items: center;
  background: none; border: 0; border-radius: var(--r-ctrl);
  cursor: pointer; color: var(--ink-faint);
}
.rowdel:hover { background: var(--brick-wash); color: var(--brick); }
.rowdel svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.ledger__foot { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-top: .7rem; flex-wrap: wrap; }

.issues { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; flex: 1; min-width: 220px; }
.issues li { font-size: var(--t-xs); padding-left: .85rem; position: relative; }
.issues li::before { content: ""; position: absolute; left: 0; top: .45em; width: 5px; height: 5px; border-radius: 50%; }
.issues li.lv-error { color: var(--brick); }
.issues li.lv-error::before { background: var(--brick); }
.issues li.lv-warn { color: var(--amber); }
.issues li.lv-warn::before { background: var(--amber); }

.empty { font-size: var(--t-sm); color: var(--ink-faint); padding: 1.1rem .25rem; }

/* --- interrupteurs --- */
.switches { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.switch__lab {
  position: relative;
  display: flex; align-items: flex-start; gap: .6rem;
  padding: .42rem .35rem; border-radius: var(--r-ctrl); cursor: pointer;
}
.switch__lab:hover { background: var(--sunk); }
/* La case native couvre toute l'étiquette : invisible, mais réellement
   cliquable et focusable, contrairement à un élément réduit à 0 × 0. */
.switch__lab input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }

.switch__ui {
  position: relative; flex: none; width: 32px; height: 18px; margin-top: .15rem;
  background: var(--rule); border-radius: 999px;
  transition: background .18s var(--ease);
}
.switch__ui::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px;
  background: var(--surface); border-radius: 50%;
  transition: transform .18s var(--ease);
  box-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.switch__lab input:checked + .switch__ui { background: var(--pine); }
.switch__lab input:checked + .switch__ui::after { transform: translateX(14px); }
.switch__lab input:focus-visible + .switch__ui { outline: 2px solid var(--pine); outline-offset: 2px; }

.switch__txt { display: grid; gap: .05rem; min-width: 0; }
.switch__name { font-size: var(--t-sm); }
.switch__hint { font-size: var(--t-xs); color: var(--ink-faint); font-family: var(--font-mono); }

/* --- alias générés --- */
.found { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; max-height: 300px; overflow: auto; }
.found__item {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .5rem;
  padding: .4rem .5rem; background: var(--sunk); border-radius: var(--r-ctrl);
}
.found__pair { display: grid; gap: .1rem; min-width: 0; font-family: var(--font-mono); font-size: var(--t-xs); }
.found__real { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.found__alias { color: var(--pine); }
.found__kind { font-size: 11px; color: var(--ink-soft); font-family: var(--font-ui); }
.found__promote {
  flex: none; padding: .22rem .45rem; font-size: var(--t-xs);
  background: none; border: 1px solid var(--rule); border-radius: var(--r-ctrl);
  cursor: pointer; color: var(--ink-soft);
}
.found__promote:hover { border-color: var(--pine); color: var(--pine); }

/* Le masquage n'est appliqué qu'aux listes : sur le calque de surlignage il
   changerait la largeur des glyphes et décalerait tout l'alignement. */
body.is-masked .found__real { filter: blur(3.5px); transition: filter .12s var(--ease); }
body.is-masked .found__real:hover,
body.is-masked .found__real:focus { filter: none; }

/* --- panneau verrouillé --- */
.locked { padding: 1rem; background: var(--sunk); border: 1px dashed var(--rule); border-radius: var(--r-ctrl); }
.locked__msg { font-size: var(--t-sm); margin-bottom: .7rem; }
.locked__row { display: flex; gap: .5rem; align-items: center; }
.locked__row .field { max-width: 280px; }
.locked__err { font-size: var(--t-sm); color: var(--brick); margin-top: .5rem; min-height: 1.2em; }

/* -------------------------------- le guide -------------------------------- */
.guide { margin-top: 2.75rem; }
.guide__title { font-size: var(--t-xl); }
.guide__lede { max-width: 62ch; margin-top: .5rem; color: var(--ink-soft); font-size: var(--t-md); }

.flow {
  list-style: none; counter-reset: step; margin: 1.75rem 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); gap: 1.25rem;
}
/* les repères numérotés sont légitimes ici : le contenu est une séquence */
.flow__step { counter-increment: step; position: relative; padding-top: 1.9rem; }
.flow__step::before {
  content: counter(step);
  position: absolute; top: 0; left: 0;
  width: 1.5rem; height: 1.5rem; display: grid; place-items: center;
  background: var(--ink); color: var(--paper);
  border-radius: 50%; font-size: var(--t-xs); font-weight: 600;
}
.flow__step::after {
  content: ""; position: absolute; top: .75rem; left: 1.9rem; right: 0; height: 1px; background: var(--rule);
}
.flow__step:last-child::after { display: none; }
.flow__h { font-size: var(--t-base); margin-bottom: .25rem; }
.flow__step p { font-size: var(--t-sm); color: var(--ink-soft); }

.sample {
  margin: .7rem 0 0; padding: .65rem .7rem;
  background: var(--surface); border: 1px solid var(--rule); border-left: 3px solid var(--brick);
  border-radius: var(--r-sheet);
  font-family: var(--font-mono); font-size: var(--t-xs); line-height: 1.6;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.sample--safe { border-left-color: var(--pine); }
.sample code { font: inherit; }

.notes {
  margin-top: 2.25rem; display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); gap: 1.25rem;
  padding-top: 1.5rem; border-top: 1px solid var(--rule);
}
.note__h { font-size: var(--t-base); margin-bottom: .3rem; }
.note p { font-size: var(--t-sm); color: var(--ink-soft); max-width: 52ch; }
.note code { font-family: var(--font-mono); font-size: .92em; background: var(--sunk); padding: .05em .3em; border-radius: 3px; }

/* -------------------------------- pied de page ---------------------------- */
.legal { border-top: 1px solid var(--rule); background: var(--surface); }
.legal__in {
  max-width: var(--shell); margin: 0 auto;
  padding: 1.5rem clamp(.85rem, 2.4vw, 1.75rem);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .7rem 1.5rem;
  font-size: var(--t-xs); color: var(--ink-soft);
}
.legal strong { color: var(--ink); font-weight: 600; }

/* --------------------------- modale et notifications ---------------------- */
.modal {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--ink) 45%, transparent);
  padding: 1rem;
}
.modal__box {
  width: min(460px, 100%);
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--r-float); box-shadow: var(--lift);
  padding: 1.25rem;
}
.modal__title { font-size: var(--t-lg); margin-bottom: .6rem; }
.modal__body { font-size: var(--t-sm); color: var(--ink-soft); display: grid; gap: .7rem; }
.modal__body .field { max-width: none; }
.modal__acts { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.1rem; }
.modal__err { color: var(--brick); min-height: 1.2em; font-size: var(--t-sm); }
.meter { height: 4px; background: var(--rule); border-radius: 999px; overflow: hidden; }
.meter__fill { height: 100%; width: 0; background: var(--pine); transition: width .2s var(--ease); }

.toasts {
  position: fixed; z-index: 70; right: 1rem; bottom: 1rem;
  display: grid; gap: .5rem; justify-items: end;
  max-width: min(360px, calc(100vw - 2rem));
}
.toast {
  padding: .6rem .8rem; background: var(--surface);
  border: 1px solid var(--rule); border-left: 3px solid var(--pine);
  border-radius: var(--r-float); box-shadow: var(--lift);
  font-size: var(--t-sm);
  animation: toast-in .22s var(--ease);
}
.toast--warn  { border-left-color: var(--amber); }
.toast--error { border-left-color: var(--brick); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

.noscript {
  max-width: 46ch; margin: 3rem auto; padding: 1rem;
  border: 1px solid var(--brick); border-radius: var(--r-ctrl);
  background: var(--brick-wash); color: var(--brick);
}

/* --------------------------------- réactif -------------------------------- */
@media (max-width: 1080px) {
  .bench { grid-template-columns: 1fr; }
  .switchboard { flex-direction: row; justify-content: center; padding: 0; }
  .act { flex: 1; max-width: 260px; }
  .workshop { grid-template-columns: 1fr; }
  .card--ledger { grid-row: auto; display: block; }
  .ledger__scroll { max-height: 420px; }
}

@media (max-width: 620px) {
  :root { --gap: .9rem; }
  .topbar__in { padding-inline: .85rem; }
  .netstate { display: none; }
  .editor__area { min-height: 200px; }
  .pane__acts .ghost { padding: .3rem .4rem; }
  .ledger__scroll { max-height: none; }
  .switchboard { flex-direction: column; }
  .act { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

@media print {
  .topbar, .switchboard, .workshop, .toasts, .modal, .skip { display: none !important; }
}
