.entity-switch {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .6rem 1rem;
  margin: 0 0 1rem 0;
  border-radius: 8px;
  color: white;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Montserrat", sans-serif;
  font-weight: 500;
  transition: background-color .2s;
}
.entity-switch .label {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  opacity: .85;
}
.entity-switch .option {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .7rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.15);
  cursor: pointer;
  font-size: .95rem;
}
.entity-switch .option.active {
  background: rgba(255, 255, 255, 0.35);
  font-weight: 600;
}
.entity-switch .option input { display: none; }
.entity-switch .readonly-badge {
  margin-left: auto;
  padding: .25rem .6rem;
  background: rgba(255,255,255,0.95);
  color: #b00020;
  border-radius: 12px;
  font-size: .8rem;
  font-weight: 600;
}
/* Sépare les outils transverses (carte etc.) des onglets entités */
.entity-switch .ot-separator {
  width: 1px;
  align-self: stretch;
  background: rgba(255, 255, 255, 0.3);
  margin: 0 .3rem;
}
.entity-switch .ot-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .7rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  text-decoration: none;
  font-size: .9rem;
  transition: background .15s;
}
.entity-switch .ot-link:hover {
  background: rgba(255, 255, 255, 0.3);
  text-decoration: none;
}
.entity-switch .ot-link.active {
  background: rgba(255, 255, 255, 0.45);
  font-weight: 600;
}
/* Mode lecture seule : désactive les boutons marqués data-write */
body.readonly-active button[data-write],
body.readonly-active [data-write] button,
body.readonly-active input[type="submit"][data-write],
body.readonly-active a[data-write] {
  opacity: 0.4 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}
body.readonly-active [data-write]::after {
  content: " 🔒";
  font-size: .85em;
}
