/*
 * Robot Maker Tool CSS
 * Contrat visuel commun v1.5.1
 *
 * Ce fichier est canonique. Il doit etre copie sans modification dans chaque
 * depot et chaque dossier publiable. Les styles metier sont charges apres lui.
 * Toutes les regles d'interface sont limitees a la racine .rm-tool, sauf le
 * masquage du menu du site en mode integre (html.rm-embedded).
 */

:root {
  --rm-css-version: "1.5.1";
  --rm-font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --rm-font-mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  --rm-radius-sm: 7px;
  --rm-radius-md: 10px;
  --rm-radius-lg: 14px;
  --rm-shadow-sm: 0 1px 2px rgb(17 42 67 / 8%);
  --rm-shadow-lg: 0 18px 55px rgb(17 42 67 / 14%);
  --rm-space-1: 4px;
  --rm-space-2: 8px;
  --rm-space-3: 12px;
  --rm-space-4: 16px;
  --rm-space-5: 24px;
  --rm-space-6: 32px;
  --rm-control-height: 38px;
  --rm-preference-field-width: 12ch;
  --rm-drawer-left-width: 300px;
  --rm-drawer-right-width: 340px;
  --rm-drawer-transition: 350ms ease;

  --rm-color-bg: #f3f7fb;
  --rm-color-surface: #ffffff;
  --rm-color-surface-soft: #f8fbfe;
  --rm-color-hover: #eef6fd;
  --rm-color-text: #17263b;
  --rm-color-muted: #66768a;
  --rm-color-border: #d6dfeb;
  --rm-color-primary: #1f6fae;
  --rm-color-primary-hover: #124c7b;
  --rm-color-primary-soft: #dceeff;
  --rm-color-topbar: #102a43;
  --rm-color-on-primary: #ffffff;
  --rm-color-success: #287351;
  --rm-color-success-hover: #1d5a3e;
  --rm-color-on-success: #ffffff;
  --rm-color-warning: #94601f;
  --rm-color-danger: #ad3c3c;
  --rm-color-on-danger: #ffffff;
  --rm-color-secondary: #e8edf3;
  --rm-color-secondary-hover: #dbe3ec;
  --rm-color-strong: #17263b;
  --rm-color-strong-hover: #0b1726;
  --rm-color-on-strong: #ffffff;
  --rm-color-caution: #94601f;
  --rm-color-caution-hover: #7a4e18;
  --rm-color-on-caution: #ffffff;
  --rm-color-focus: #1f6fae;
  color-scheme: light;
}

html[data-theme="light"] {
  color-scheme: light;
}

html[data-theme="dark"] {
  --rm-color-bg: #101923;
  --rm-color-surface: #172431;
  --rm-color-surface-soft: #1c2c3b;
  --rm-color-hover: #203346;
  --rm-color-text: #eaf2fb;
  --rm-color-muted: #a4b4c5;
  --rm-color-border: #34495e;
  --rm-color-primary: #4da3e3;
  --rm-color-primary-hover: #8cc8f2;
  --rm-color-primary-soft: #203d57;
  --rm-color-topbar: #09131f;
  --rm-color-on-primary: #07131e;
  --rm-color-success: #72c49d;
  --rm-color-success-hover: #9ad8b8;
  --rm-color-on-success: #07130e;
  --rm-color-warning: #edbd72;
  --rm-color-danger: #ef8a8a;
  --rm-color-on-danger: #1f0a0a;
  --rm-color-secondary: #243546;
  --rm-color-secondary-hover: #2d4257;
  --rm-color-strong: #eaf2fb;
  --rm-color-strong-hover: #c9dbee;
  --rm-color-on-strong: #101923;
  --rm-color-caution: #edbd72;
  --rm-color-caution-hover: #f3cf95;
  --rm-color-on-caution: #1f1405;
  --rm-color-focus: #8cc8f2;
  --rm-shadow-sm: 0 1px 2px rgb(0 0 0 / 20%);
  --rm-shadow-lg: 0 18px 55px rgb(0 0 0 / 35%);
  color-scheme: dark;
}

.rm-tool,
.rm-tool *,
.rm-tool *::before,
.rm-tool *::after {
  box-sizing: border-box;
}

.rm-tool {
  min-width: 0;
  min-height: 100%;
  margin: 0;
  background: var(--rm-color-bg);
  color: var(--rm-color-text);
  font-family: var(--rm-font-sans);
  font-size: 16px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

.rm-tool img,
.rm-tool svg,
.rm-tool canvas,
.rm-tool video {
  max-width: 100%;
}

/* Un lien presente comme un bouton (telechargement, ouverture) garde les couleurs de son bouton. */
.rm-tool a:where(:not(.rm-button, .rm-icon-button, .rm-icon-action)) {
  color: var(--rm-color-primary);
  text-underline-offset: 0.16em;
}

.rm-tool a:where(:not(.rm-button, .rm-icon-button, .rm-icon-action)):hover {
  color: var(--rm-color-primary-hover);
}

.rm-tool code,
.rm-tool pre,
.rm-tool kbd,
.rm-tool samp,
.rm-tool .rm-monospace {
  font-family: var(--rm-font-mono);
}

.rm-tool-header {
  display: flex;
  align-items: center;
  min-height: 56px;
  gap: var(--rm-space-4);
  padding: var(--rm-space-2) var(--rm-space-4);
  background: var(--rm-color-topbar);
  color: #ffffff;
}

/* En-tete responsive a cinq zones, pilote par robot-maker-tool-header.js. */
.rm-responsive-header {
  position: relative;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 2px;
}

.rm-responsive-header > .rm-header-far-left { grid-column: 1; }
.rm-responsive-header > .rm-header-left { grid-column: 2; }
.rm-responsive-header > .rm-header-right { grid-column: 4; }
.rm-responsive-header > .rm-header-far-right { grid-column: 5; }

.rm-responsive-header[data-rm-header-layout="one"] > .rm-header-center {
  position: absolute;
  top: 50%;
  left: var(--rm-header-center-left, 50%);
  transform: translateY(-50%);
}

.rm-responsive-header[data-rm-header-layout="two"] > .rm-header-center {
  position: static;
  grid-row: 2;
  grid-column: 1 / -1;
  justify-self: center;
  transform: none;
}

/* Trois lignes : trois colonnes. Avec les cinq colonnes, les groupes de la deuxieme ligne
   elargissaient celles de la premiere et les colonnes vides gardaient leurs espaces : l'en-tete
   debordait de l'ecran (telephone). La marque peut se replier pour laisser place aux preferences.
   Les preferences couvrent les colonnes 2 et 3, la zone droite seulement la colonne 3 : la zone
   gauche (colonnes 1 et 2) n'est donc limitee que par la zone droite, pas par les preferences.
   Seule sur sa ligne, une zone laterale occupe toute la largeur. */
.rm-responsive-header[data-rm-header-layout="three"] {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.rm-responsive-header[data-rm-header-layout="three"] > .rm-header-far-left {
  grid-column: 1;
  min-width: 0;
}

.rm-responsive-header[data-rm-header-layout="three"] > .rm-header-left {
  grid-row: 2;
  grid-column: 1 / -1;
  justify-self: start;
}

.rm-responsive-header[data-rm-header-layout="three"] > .rm-header-right {
  grid-row: 2;
  grid-column: 1 / -1;
  justify-self: end;
  min-width: max-content;
}

.rm-responsive-header[data-rm-header-layout="three"]:has(> .rm-header-right) > .rm-header-left {
  grid-column: 1 / 3;
}

.rm-responsive-header[data-rm-header-layout="three"]:has(> .rm-header-left) > .rm-header-right {
  grid-column: 3;
}

.rm-responsive-header[data-rm-header-layout="three"] > .rm-header-center {
  position: static;
  grid-row: 3;
  grid-column: 1 / -1;
  justify-self: center;
  transform: none;
}

.rm-tool-brand {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: max-content;
  gap: var(--rm-space-3);
  font-weight: 750;
}

.rm-tool-brand > :last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rm-tool-preferences {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: max-content;
  gap: var(--rm-space-2);
  margin-left: auto;
}

.rm-tool .rm-tool-preferences select.rm-field {
  flex: 0 0 auto;
  width: var(--rm-preference-field-width);
  min-width: var(--rm-preference-field-width);
}

.rm-tool-header > .rm-tool-preferences {
  grid-row: 1;
  grid-column: -1;
  justify-self: end;
  align-self: center;
  margin-left: 0;
}

.rm-responsive-header > .rm-tool-preferences.rm-header-far-right {
  grid-column: 5;
}

.rm-responsive-header[data-rm-header-layout="three"] > .rm-header-far-right {
  grid-column: 2 / -1;
}

.rm-tool-header .rm-tool-preferences label {
  color: inherit;
}

/* Barre superieure : titre, onglets et commandes identiques dans tous les outils.
   Rendu de reference : Sumo Simulator. Le CSS metier ne redefinit pas ces regles. */
.rm-tool-header {
  font-size: 14px;
  line-height: 1.4;
  --rm-header-muted: #aebdcb;
  --rm-header-accent: #62b4ec;
  --rm-header-line: rgb(255 255 255 / 22%);
  --rm-header-fill: rgb(255 255 255 / 8%);
  --rm-header-fill-hover: rgb(255 255 255 / 16%);
}

/* Titre : nom complet en <strong> ou <b>, signature Robot Maker en <small>. */
.rm-tool-header .rm-tool-brand {
  gap: 10px;
  color: #ffffff;
}

.rm-tool-header button.rm-tool-brand {
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #ffffff;
  text-align: left;
  cursor: pointer;
}

.rm-tool-header .rm-tool-brand > :is(div, span) {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.rm-tool-header .rm-tool-brand :is(strong, b) {
  display: block;
  color: #ffffff;
  font-size: 15px;
  font-weight: 750;
  white-space: nowrap;
}

.rm-tool-header .rm-tool-brand small {
  display: block;
  color: var(--rm-header-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Onglets : groupe encadre, separateurs et soulignement de l'onglet actif. */
.rm-tool-header .rm-tabs {
  align-self: center;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--rm-header-line);
  border-radius: var(--rm-radius-md);
  background: rgb(255 255 255 / 6%);
}

.rm-tool-header .rm-tab {
  min-height: 0;
  padding: 9px 6px 7px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--rm-header-muted);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.rm-tool-header .rm-tab + .rm-tab {
  border-left: 1px solid rgb(255 255 255 / 16%);
}

.rm-tool-header .rm-tab:hover {
  background: rgb(255 255 255 / 6%);
  color: #ffffff;
}

.rm-tool-header .rm-tab:is([aria-selected="true"], [aria-current="page"]) {
  border-color: transparent;
  border-bottom-color: var(--rm-header-accent);
  background: transparent;
  color: #ffffff;
  font-weight: 600;
}

.rm-tool-header .rm-tab:focus-visible {
  outline-offset: -2px;
}

/* Commandes : boutons, listes et champs clairs sur fond translucide. */
.rm-tool-header :is(button, select) {
  white-space: nowrap;
}

/* Police de l'en-tete protegee contre les tailles du CSS metier (14 px partout). */
.rm-tool-header :is(button, select, input) {
  font-family: inherit;
  font-size: inherit;
}

.rm-tool-header :is(.rm-button:not(.rm-button--primary):not(.rm-button--danger), .rm-icon-button, select.rm-field, input.rm-field) {
  border-color: var(--rm-header-line);
  background: var(--rm-header-fill);
  color: #ffffff;
}

.rm-tool-header :is(.rm-button:not(.rm-button--primary):not(.rm-button--danger), .rm-icon-button, select.rm-field, input.rm-field):hover {
  border-color: var(--rm-header-line);
  background: var(--rm-header-fill-hover);
}

.rm-tool-header .rm-icon-button {
  font-weight: 800;
}

/* Action principale de l'en-tete : l'export (ou le menu de donnees qui commence par l'export) est mis
   en avant par un seul bouton .rm-button--primary dans .rm-header-right, identique dans tous les outils. */
.rm-tool-header .rm-header-right .rm-button--primary,
.rm-tool-header .rm-button--primary.rm-header-right {
  min-height: var(--rm-control-height);
  padding: var(--rm-space-2) var(--rm-space-3);
  border: 1px solid var(--rm-color-primary);
  border-radius: var(--rm-radius-sm);
  background: var(--rm-color-primary);
  color: var(--rm-color-on-primary);
  font-weight: 650;
  line-height: 1.2;
}

.rm-tool-header .rm-header-right .rm-button--primary:hover,
.rm-tool-header .rm-button--primary.rm-header-right:hover {
  border-color: var(--rm-color-primary-hover);
  background: var(--rm-color-primary-hover);
  color: var(--rm-color-on-primary);
}

/* Menu ouvert par l'action principale : options d'export d'abord, import ensuite. */
.rm-tool-header .rm-header-menu {
  position: relative;
}

.rm-tool-header .rm-header-menu-list {
  position: absolute;
  top: calc(100% + var(--rm-space-1));
  right: 0;
  z-index: 40;
  display: grid;
  min-width: 230px;
  padding: var(--rm-space-1);
  border: 1px solid var(--rm-color-border);
  border-radius: var(--rm-radius-md);
  background: var(--rm-color-surface);
  box-shadow: var(--rm-shadow-lg);
}

.rm-tool-header .rm-header-menu-list[hidden] {
  display: none;
}

.rm-tool-header .rm-header-menu-list > button {
  min-height: var(--rm-control-height);
  padding: var(--rm-space-2) var(--rm-space-3);
  border: 0;
  border-radius: var(--rm-radius-sm);
  background: transparent;
  color: var(--rm-color-text);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.rm-tool-header .rm-header-menu-list > button:hover {
  background: var(--rm-color-hover);
}

.rm-tool-header .rm-header-menu-list > hr {
  width: 100%;
  margin: var(--rm-space-1) 0;
  border: 0;
  border-top: 1px solid var(--rm-color-border);
}

.rm-tool .rm-tool-header select.rm-field {
  padding: var(--rm-space-1) var(--rm-space-2);
}

.rm-tool-header input.rm-field::placeholder {
  color: var(--rm-header-muted);
}

.rm-tool-header select option {
  background: var(--rm-color-surface);
  color: var(--rm-color-text);
}

@media (max-width: 760px) {
  .rm-tool-header .rm-tab {
    padding: 10px 8px;
  }

  /* Telephone : le titre peut passer sur deux lignes. */
  .rm-tool-header .rm-tool-brand > :is(div, span) {
    min-width: 0;
  }

  .rm-tool-header .rm-tool-brand :is(strong, b) {
    white-space: normal;
  }
}

.rm-tool-main {
  width: 100%;
  min-width: 0;
  padding: var(--rm-space-4);
}

.rm-toolbar,
.rm-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--rm-space-2);
}

.rm-toolbar {
  padding: var(--rm-space-2) var(--rm-space-3);
  border: 1px solid var(--rm-color-border);
  border-radius: var(--rm-radius-md);
  background: var(--rm-color-surface);
  box-shadow: var(--rm-shadow-sm);
}

.rm-sidebar {
  min-width: 220px;
  padding: var(--rm-space-4);
  border: 1px solid var(--rm-color-border);
  background: var(--rm-color-surface);
}

/* Panneaux repliables. Le bouton reste hors du panneau lorsque celui-ci est ferme. */
.rm-drawer-layout {
  position: relative;
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.rm-drawer-main {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
}

.rm-drawer {
  --rm-drawer-width: var(--rm-drawer-right-width);
  flex: 0 0 auto;
  align-self: stretch;
  width: var(--rm-drawer-width);
  max-width: min(42vw, var(--rm-drawer-width));
  height: 100%;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  border-left: 1px solid var(--rm-color-border);
  background: var(--rm-color-surface);
  color: var(--rm-color-text);
  transition: width var(--rm-drawer-transition), height var(--rm-drawer-transition), visibility 0s;
  scrollbar-gutter: stable;
}

.rm-drawer--left {
  --rm-drawer-width: var(--rm-drawer-left-width);
  border-right: 1px solid var(--rm-color-border);
  border-left: 0;
}

.rm-drawer-header {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: calc(var(--rm-control-height) + 2 * var(--rm-space-2));
  gap: var(--rm-space-2);
  padding: var(--rm-space-2);
  border-bottom: 1px solid var(--rm-color-border);
}

.rm-drawer-title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rm-drawer-toggle {
  z-index: 6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 var(--rm-control-height);
  width: var(--rm-control-height);
  height: var(--rm-control-height);
  min-height: var(--rm-control-height);
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--rm-radius-sm);
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.rm-drawer-toggle:hover {
  border-color: var(--rm-color-primary);
  background: var(--rm-color-hover);
}

.rm-drawer-layout > .rm-drawer-toggle {
  position: absolute;
  top: var(--rm-space-2);
}

.rm-drawer-layout > .rm-drawer-toggle--left {
  left: var(--rm-space-2);
}

.rm-drawer-layout > .rm-drawer-toggle.left {
  left: var(--rm-space-2);
}

.rm-drawer-layout > .rm-drawer-toggle--right {
  right: var(--rm-space-2);
}

.rm-drawer-layout > .rm-drawer-toggle.right {
  right: var(--rm-space-2);
}

.rm-drawer-toggle[aria-expanded="false"] {
  border-color: var(--rm-color-border);
  background: var(--rm-color-surface);
  box-shadow: var(--rm-shadow-lg);
}

.rm-drawer:is(.collapsed, .is-collapsed) {
  width: 0;
  height: calc(var(--rm-control-height) + 2 * var(--rm-space-2));
  overflow: hidden;
  border-width: 0;
  visibility: hidden;
  transition: width var(--rm-drawer-transition), height var(--rm-drawer-transition), border-width 0s 350ms, visibility 0s 350ms;
}

.rm-drawer:is(.collapsed, .is-collapsed) > *,
.rm-drawer:is(.folding, .is-folding) > * {
  min-width: var(--rm-drawer-width);
}

.rm-drawer:is(.folding, .is-folding) {
  overflow: hidden;
}

.rm-drawer:is(.instant, .is-instant) {
  transition: none;
}

/* Les volets touchent les bords de la zone de travail : aucune marge n'est reservee autour. */
.rm-tool-main.rm-drawer-layout,
.rm-tool-main:has(> .rm-drawer-layout) {
  padding: 0;
}

/* .rm-drawer-clear : premiere ligne de la zone centrale (titre, nom, barre d'outils). Quand un volet
   est replie, seule cette ligne se decale pour laisser la place a son bouton, comme la coupe et la cle
   de Sumo Simulator : aucune colonne n'est reservee. --rm-drawer-clear-offset indique la distance qui
   separe deja la ligne du bord de la zone de travail (marges de la zone et de la carte). */
.rm-drawer-clear {
  transition: padding var(--rm-drawer-transition);
}

.rm-drawer-layout:has(> .rm-drawer--left:is(.collapsed, .is-collapsed)) .rm-drawer-clear {
  padding-left: max(0px, calc(var(--rm-control-height) + 2 * var(--rm-space-2) - var(--rm-drawer-clear-offset, 0px)));
}

.rm-drawer-layout:has(> .rm-drawer--left:is(.collapsed, .is-collapsed)) > .rm-drawer--right:not(.collapsed):not(.is-collapsed) .rm-drawer-header {
  padding-left: calc(var(--rm-control-height) + 2 * var(--rm-space-2));
}

@media (min-width: 761px) and (orientation: landscape) {
  .rm-drawer-layout:has(> .rm-drawer--right:is(.collapsed, .is-collapsed)) .rm-drawer-clear {
    padding-right: max(0px, calc(var(--rm-control-height) + 2 * var(--rm-space-2) - var(--rm-drawer-clear-offset, 0px)));
  }

  .rm-drawer-layout:has(> .rm-drawer--right:is(.collapsed, .is-collapsed)) > .rm-drawer--left:not(.collapsed):not(.is-collapsed) .rm-drawer-header {
    padding-right: calc(var(--rm-control-height) + 2 * var(--rm-space-2));
  }
}

.rm-panel,
.rm-card {
  min-width: 0;
  border: 1px solid var(--rm-color-border);
  background: var(--rm-color-surface);
  color: var(--rm-color-text);
  box-shadow: var(--rm-shadow-sm);
}

.rm-panel {
  padding: var(--rm-space-4);
  border-radius: var(--rm-radius-lg);
}

.rm-card {
  padding: var(--rm-space-3);
  border-radius: var(--rm-radius-md);
}

/* Remise a zero sans specificite : les tailles choisies par le CSS metier pour ses propres
   controles (champs numeriques compacts, curseurs...) ne sont jamais ecrasees. */
:where(.rm-tool) :where(button, input, select, textarea) {
  margin: 0;
  font: inherit;
}

.rm-button,
.rm-icon-button,
.rm-tool .rm-field,
.rm-tool input.rm-field,
.rm-tool select.rm-field,
.rm-tool textarea.rm-field {
  min-height: var(--rm-control-height);
  border: 1px solid var(--rm-color-border);
  border-radius: var(--rm-radius-sm);
  background: var(--rm-color-surface);
  color: var(--rm-color-text);
}

.rm-button,
.rm-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--rm-space-2);
  padding: var(--rm-space-2) var(--rm-space-3);
  cursor: pointer;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
}

.rm-button:hover,
.rm-icon-button:hover {
  border-color: var(--rm-color-primary);
  background: var(--rm-color-hover);
}

/* Bouton secondaire par defaut : gris, distinct d'un champ de saisie. */
.rm-button,
.rm-icon-action {
  background: var(--rm-color-secondary);
}

/* Survol gris reserve aux boutons sans variante : principal, discret et intentions gardent le leur. */
.rm-button:not([class*="rm-button--"]):hover:not(:disabled),
.rm-icon-action:not([class*="rm-button--"]):hover:not(:disabled) {
  border-color: var(--rm-color-border);
  background: var(--rm-color-secondary-hover);
}

.rm-button--primary {
  border-color: var(--rm-color-primary);
  background: var(--rm-color-primary);
  color: var(--rm-color-on-primary);
}

.rm-button--primary:hover {
  border-color: var(--rm-color-primary-hover);
  background: var(--rm-color-primary-hover);
  color: var(--rm-color-on-primary);
}

.rm-button--danger {
  border-color: var(--rm-color-danger) !important;
  background: var(--rm-color-danger) !important;
  /* Texte selon le theme : blanc sur rouge fonce, sombre sur rouge clair (theme sombre). */
  color: var(--rm-color-on-danger) !important;
}

.rm-button--danger:hover:not(:disabled) {
  filter: brightness(0.9);
}

.rm-button--create {
  border-color: var(--rm-color-success) !important;
  background: var(--rm-color-success) !important;
  color: var(--rm-color-on-success) !important;
}

.rm-button--create:hover:not(:disabled) {
  border-color: var(--rm-color-success-hover) !important;
  background: var(--rm-color-success-hover) !important;
  color: var(--rm-color-on-success) !important;
}

/* Action principale qui n'est pas un export : valider, passer a l'etape suivante, appliquer partout. */
.rm-button--strong {
  border-color: var(--rm-color-strong) !important;
  background: var(--rm-color-strong) !important;
  color: var(--rm-color-on-strong) !important;
}

.rm-button--strong:hover:not(:disabled) {
  border-color: var(--rm-color-strong-hover) !important;
  background: var(--rm-color-strong-hover) !important;
  color: var(--rm-color-on-strong) !important;
}

/* Action a effet large mais reversible : remplacer, reinitialiser, appliquer un fichier. */
.rm-button--caution {
  border-color: var(--rm-color-caution) !important;
  background: var(--rm-color-caution) !important;
  color: var(--rm-color-on-caution) !important;
}

.rm-button--caution:hover:not(:disabled) {
  border-color: var(--rm-color-caution-hover) !important;
  background: var(--rm-color-caution-hover) !important;
  color: var(--rm-color-on-caution) !important;
}

.rm-button--quiet {
  border-color: transparent;
  background: transparent;
  color: inherit;
  box-shadow: none;
}

.rm-icon-button {
  width: var(--rm-control-height);
  padding: 0;
}

/* Petite action carrée commune : ajouter, modifier, voir ou supprimer. */
.rm-icon-action {
  display: inline-grid;
  place-items: center;
  flex: 0 0 var(--rm-control-height);
  width: var(--rm-control-height) !important;
  height: var(--rm-control-height) !important;
  min-width: var(--rm-control-height);
  min-height: var(--rm-control-height);
  padding: 0 !important;
  border: 1px solid var(--rm-color-border);
  border-radius: var(--rm-radius-sm);
  color: var(--rm-color-text);
  font-weight: 650;
  line-height: 1;
  cursor: pointer;
}

/* Sans intention, l'action carree est secondaire (gris) ; les variantes imposent leurs couleurs. */

.rm-tool .rm-field,
.rm-tool input.rm-field,
.rm-tool select.rm-field,
.rm-tool textarea.rm-field {
  width: 100%;
  padding: var(--rm-space-2) var(--rm-space-3);
}

.rm-tool textarea.rm-field {
  min-height: 96px;
  resize: vertical;
}

.rm-field-group {
  display: grid;
  gap: var(--rm-space-1);
}

.rm-field-label {
  color: var(--rm-color-text);
  font-size: 0.875rem;
  font-weight: 650;
}

.rm-field-help {
  color: var(--rm-color-muted);
  font-size: 0.8125rem;
}

/* Commandes de reglage compactes, reference Photo Editor : curseur, champ numerique et interrupteur.
   Le champ numerique et l'interrupteur doublent un curseur ou une option dans un panneau dense ; ils
   derogent a la hauteur minimale de 38 px, comme prevu pour une variante dense. */
.rm-tool .rm-range {
  display: block;
  width: 100%;
  height: 12px;
  margin: 0;
  accent-color: var(--rm-color-primary);
  cursor: pointer;
}

.rm-tool .rm-number {
  width: 62px;
  height: 24px;
  min-height: 0;
  padding: 2px 5px;
  border: 1px solid var(--rm-color-border);
  border-radius: 6px;
  background: var(--rm-color-surface-soft);
  color: var(--rm-color-primary-hover);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.rm-tool .rm-number--mini {
  width: 48px;
}

.rm-tool .rm-number:focus {
  border-color: var(--rm-color-primary);
}

.rm-tool .rm-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
}

.rm-tool .rm-switch > input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

.rm-tool .rm-switch > input + span {
  position: relative;
  flex: 0 0 auto;
  width: 30px;
  height: 18px;
  border-radius: 999px;
  background: #bdc5ce;
  transition: background-color 0.2s;
}

.rm-tool .rm-switch > input + span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  transition: left 0.2s;
}

.rm-tool .rm-switch > input:checked + span {
  background: var(--rm-color-primary);
}

.rm-tool .rm-switch > input:checked + span::after {
  left: 15px;
}

.rm-tool .rm-switch > input:focus-visible + span {
  outline: 2px solid var(--rm-color-focus);
  outline-offset: 2px;
}

.rm-tool .rm-switch > input:disabled + span {
  opacity: 0.55;
}

.rm-tool :where(.rm-button, .rm-icon-button, .rm-field):focus-visible,
.rm-tool :where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--rm-color-focus);
  outline-offset: 2px;
}

.rm-tool :where(button, input, select, textarea):disabled,
.rm-tool [aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
}

.rm-tabs,
.rm-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--rm-space-1);
}

.rm-tabs {
  flex: 0 0 auto;
  min-width: max-content;
  flex-wrap: nowrap;
}

.rm-tab,
.rm-nav-link {
  min-height: var(--rm-control-height);
  padding: var(--rm-space-2) var(--rm-space-3);
  border: 1px solid transparent;
  border-radius: var(--rm-radius-sm);
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}

.rm-tab:hover,
.rm-nav-link:hover {
  background: var(--rm-color-hover);
}

.rm-tab[aria-selected="true"],
.rm-nav-link[aria-current="page"] {
  border-color: var(--rm-color-primary);
  background: var(--rm-color-primary-soft);
  color: var(--rm-color-primary-hover);
}

.rm-table-wrap {
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--rm-color-border);
  border-radius: var(--rm-radius-md);
}

.rm-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--rm-color-surface);
}

.rm-table th,
.rm-table td {
  padding: var(--rm-space-2) var(--rm-space-3);
  border-bottom: 1px solid var(--rm-color-border);
  text-align: left;
  vertical-align: top;
}

.rm-table th {
  background: var(--rm-color-surface-soft);
  font-weight: 700;
}

.rm-table tbody tr:hover {
  background: var(--rm-color-hover);
}

.rm-table tr:last-child > * {
  border-bottom: 0;
}

.rm-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px var(--rm-space-2);
  border: 1px solid var(--rm-color-border);
  border-radius: 999px;
  background: var(--rm-color-surface-soft);
  color: var(--rm-color-text);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.rm-badge--success { color: var(--rm-color-success); }
.rm-badge--warning { color: var(--rm-color-warning); }
.rm-badge--danger { color: var(--rm-color-danger); }

.rm-notice {
  padding: var(--rm-space-3) var(--rm-space-4);
  border: 1px solid var(--rm-color-border);
  border-left: 4px solid var(--rm-color-primary);
  border-radius: var(--rm-radius-md);
  background: var(--rm-color-surface-soft);
}

.rm-notice--success { border-left-color: var(--rm-color-success); }
.rm-notice--warning { border-left-color: var(--rm-color-warning); }
.rm-notice--danger { border-left-color: var(--rm-color-danger); }

.rm-dialog {
  max-width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--rm-color-border);
  border-radius: var(--rm-radius-lg);
  background: var(--rm-color-surface);
  color: var(--rm-color-text);
  box-shadow: var(--rm-shadow-lg);
}

.rm-dialog::backdrop {
  background: rgb(7 19 30 / 65%);
}

.rm-dialog-header,
.rm-dialog-body,
.rm-dialog-footer {
  padding: var(--rm-space-4);
}

.rm-dialog-header,
.rm-dialog-footer {
  display: flex;
  align-items: center;
  gap: var(--rm-space-2);
}

.rm-dialog-header {
  border-bottom: 1px solid var(--rm-color-border);
}

.rm-dialog-footer {
  justify-content: flex-end;
  border-top: 1px solid var(--rm-color-border);
}

.rm-empty-state {
  display: grid;
  place-items: center;
  min-height: 160px;
  padding: var(--rm-space-5);
  border: 1px dashed var(--rm-color-border);
  border-radius: var(--rm-radius-md);
  color: var(--rm-color-muted);
  text-align: center;
}

.rm-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--rm-color-border);
  border-top-color: var(--rm-color-primary);
  border-radius: 50%;
  animation: rm-spin 0.8s linear infinite;
}

@keyframes rm-spin {
  to { transform: rotate(1turn); }
}

.rm-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.rm-tool [hidden],
.rm-hidden {
  display: none !important;
}

.rm-tool--viewer {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

.rm-tool--viewer .rm-tool-main {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

/* Mode integre : pose par robot-maker-tool-embed.js. Le menu du site ne reserve aucune place. */
html.rm-embedded #rm-menu-container {
  display: none;
}

.rm-tool--embedded .rm-tool-header {
  min-height: 48px;
}

.rm-tool--embedded .rm-tool-main {
  padding: var(--rm-space-3);
}

.rm-print-surface {
  background: #ffffff;
  color: #17263b;
}

@media (max-width: 720px) {
  :root {
    --rm-control-height: 42px;
  }

  .rm-tool-header {
    align-items: stretch;
    flex-wrap: wrap;
    gap: var(--rm-space-2);
    padding: var(--rm-space-2) var(--rm-space-3);
  }

  .rm-tool-brand {
    flex: 1 1 auto;
  }

  .rm-tool-preferences {
    max-width: 100%;
  }

  .rm-tool .rm-tool-preferences select.rm-field {
    width: var(--rm-preference-field-width);
    min-width: var(--rm-preference-field-width);
    max-width: none;
  }

  .rm-tool-main {
    padding: var(--rm-space-3);
  }

  .rm-sidebar {
    min-width: 0;
  }

  .rm-dialog {
    max-width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }
}

/* Panneaux empiles : un seul defilement vertical porte sur toute la page. */
@media (max-width: 760px), (orientation: portrait) {
  .rm-tool:has(.rm-drawer-layout) {
    height: auto;
    min-height: 100%;
    overflow: visible;
  }

  .rm-tool--viewer:has(.rm-drawer-layout) {
    min-height: 100dvh;
  }

  .rm-tool--viewer:has(.rm-drawer-layout) .rm-tool-main {
    flex: none;
    min-height: 0;
    overflow: visible;
  }

  .rm-drawer-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    flex: none;
    width: 100%;
    height: auto;
    min-height: 0;
    padding-right: 0;
    padding-left: 0;
    overflow: visible;
  }

  .rm-drawer-layout > .rm-drawer-toggle--left,
  .rm-drawer-layout > .rm-drawer-toggle.left {
    grid-row: 1;
    align-self: start;
    justify-self: start;
    top: var(--rm-space-2);
    right: auto;
    bottom: auto;
    left: var(--rm-space-2);
  }

  .rm-drawer-layout > .rm-drawer-toggle--right,
  .rm-drawer-layout > .rm-drawer-toggle.right {
    grid-row: 2;
    align-self: end;
    justify-self: end;
    top: auto;
    right: var(--rm-space-2);
    bottom: var(--rm-space-2);
    left: auto;
  }

  .rm-drawer-main {
    grid-row: 2;
    order: 2;
    flex: none;
    width: 100%;
    min-height: 0;
    overflow: visible;
  }

  .rm-drawer,
  .rm-drawer--left,
  .rm-drawer--right {
    width: 100%;
    max-width: none;
    height: auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: visible;
    border-right: 0;
    border-left: 0;
    scrollbar-gutter: auto;
    transition: height var(--rm-drawer-transition), visibility 0s;
  }

  .rm-drawer--left {
    grid-row: 1;
    order: 1;
    border-bottom: 1px solid var(--rm-color-border);
  }

  .rm-drawer--right {
    grid-row: 3;
    order: 3;
    border-top: 1px solid var(--rm-color-border);
  }

  .rm-drawer:is(.collapsed, .is-collapsed) {
    display: none;
    width: 0;
    height: 0;
    min-height: 0;
    overflow: hidden;
    border-width: 0;
    visibility: hidden;
  }

  .rm-drawer:is(.collapsed, .is-collapsed) > *,
  .rm-drawer:is(.folding, .is-folding) > * {
    min-width: 0;
  }

  .rm-tool--viewer:has(.rm-drawer--left:is(.collapsed, .is-collapsed)):has(.rm-drawer--right:is(.collapsed, .is-collapsed)) {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .rm-tool--viewer:has(.rm-drawer--left:is(.collapsed, .is-collapsed)):has(.rm-drawer--right:is(.collapsed, .is-collapsed)) .rm-tool-main,
  .rm-tool--viewer:has(.rm-drawer--left:is(.collapsed, .is-collapsed)):has(.rm-drawer--right:is(.collapsed, .is-collapsed)) .rm-drawer-layout,
  .rm-tool--viewer:has(.rm-drawer--left:is(.collapsed, .is-collapsed)):has(.rm-drawer--right:is(.collapsed, .is-collapsed)) .rm-drawer-main {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    overflow: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rm-tool *,
  .rm-tool *::before,
  .rm-tool *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .rm-tool {
    background: #ffffff;
    color: #17263b;
  }

  .rm-tool-header,
  .rm-toolbar,
  .rm-sidebar,
  .rm-no-print {
    display: none !important;
  }

  .rm-tool-main {
    padding: 0;
  }

  .rm-panel,
  .rm-card,
  .rm-print-surface {
    border: 0;
    background: #ffffff;
    color: #17263b;
    box-shadow: none;
  }
}
