.bpmn-editor {
  display: flex;
  flex-direction: column;
  height: 78vh;
  min-height: 480px;
  border: 1px solid #d4d4d4;
  border-radius: 4px;
  overflow: hidden;
  font-family: sans-serif;
}

/* Filling the whole screen while fullscreen is the point of the button;
   trust the browser's native fullscreen layout for sizing and only
   override the background so there's no default black/transparent
   flash around the edges during the transition. */
.bpmn-editor:fullscreen {
  background: #fff;
}

/* Raw XML edit field on the diagram's Settings form (BpmnDiagramForm). */
.bpmn-editor__xml-textarea {
  font-family: monospace;
  font-size: 0.8rem;
  white-space: pre;
  overflow-x: auto;
}

.bpmn-editor__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: #fafafa;
  border-bottom: 1px solid #d4d4d4;
  flex: 0 0 auto;
}

.bpmn-editor__toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bpmn-editor__button {
  padding: 0.35rem 0.75rem;
  border: 1px solid #b7b7b7;
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1.2;
}

.bpmn-editor__button:hover {
  background: #f0f0f0;
}

.bpmn-editor__button--primary {
  background: #0074bd;
  border-color: #0074bd;
  color: #fff;
}

.bpmn-editor__button--primary:hover {
  background: #005a91;
}

.bpmn-editor__button:disabled {
  opacity: 0.5;
  cursor: default;
}

.bpmn-editor__status {
  font-size: 0.8rem;
  color: #5c5c5c;
}

.bpmn-editor__status--dirty {
  color: #9a6700;
}

.bpmn-editor__status--saving {
  color: #0074bd;
}

.bpmn-editor__status--error {
  color: #c0143c;
  font-weight: 600;
}

.bpmn-editor__badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  background: #ececec;
  font-size: 0.75rem;
  color: #5c5c5c;
}

.bpmn-editor__body {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

.bpmn-editor__canvas {
  flex: 1 1 auto;
  position: relative;
  background: #fff;
  min-width: 0;
}

.bpmn-editor__properties {
  flex: 0 0 300px;
  width: 300px;
  overflow-y: auto;
  padding: 0.75rem;
  background: #fafafa;
  border-left: 1px solid #d4d4d4;
  font-size: 0.85rem;
}

/* bpmn-js injects its own .djs-container into the canvas div; make sure
   it fills the available space. */
.bpmn-editor__canvas .djs-container {
  height: 100% !important;
}

/* Hover cursor for a Data Store Reference linked to an application (see
   bindApplicationLinks() in js/bpmn-editor.js). !important because the
   read-only NavigatedViewer sets its own "grab"-style cursor for canvas
   panning, at a point that can otherwise win over a plain, non-important
   override depending on event ordering. */
.bpmn-editor__linked-element,
.bpmn-editor__linked-element * {
  cursor: pointer !important;
}

/* Retired-application marker (canvas.addMarker('bpmn-editor-retired'),
   set in checkApplicationLifecycles() / setRetiredMarker() in
   js/bpmn-editor.js). Follows bpmn-js's own documented pattern for
   conditional element coloring: https://github.com/bpmn-io/bpmn-js-examples/tree/main/colors
   - target the first child of .djs-visual (the actual shape path/rect)
   with !important, since the default renderer already sets fill/stroke
   inline and a plain override would lose to that otherwise. Excludes
   .djs-connection defensively, matching the official example, even
   though a DataStoreReference is always a shape, never a connection. */
.bpmn-editor-retired:not(.djs-connection) .djs-visual > :first-child {
  fill: #fbe3e3 !important;
  stroke: #c0143c !important;
}

/* "- (Retired)" overlay text (Overlays#add(), same method) - styled to
   read as a continuation of the element's own label immediately below
   it, without actually being part of that label's real text content. */
.bpmn-editor__retired-badge {
  display: inline-block;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 600;
  color: #c0143c;
}

/* Properties panel content - see js/bpmn-properties-panel.js. */
.bpmn-properties__empty {
  color: #5c5c5c;
  font-style: italic;
}

.bpmn-properties__heading {
  margin: 0 0 0.15rem;
  font-size: 0.95rem;
}

.bpmn-properties__id {
  margin: 0 0 1rem;
  font-family: monospace;
  font-size: 0.75rem;
  color: #5c5c5c;
  word-break: break-all;
}

.bpmn-properties__field {
  margin-bottom: 1rem;
}

.bpmn-properties__field--application {
  position: relative;
}

.bpmn-properties__label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.bpmn-properties__input {
  width: 100%;
  padding: 0.35rem 0.5rem;
  border: 1px solid #b7b7b7;
  border-radius: 3px;
  font-size: 0.85rem;
  box-sizing: border-box;
}

.bpmn-properties__input:disabled {
  background: #ececec;
  color: #8c8c8c;
}

.bpmn-properties__hint {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: #8c8c8c;
}

.bpmn-properties__hint--linked {
  color: #0074bd;
  font-weight: 600;
}

/* Color section (buildColorField() in js/bpmn-properties-panel.js). */
.bpmn-properties__swatches {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.bpmn-properties__swatch {
  width: 1.75rem;
  height: 1.75rem;
  border-width: 2px;
  border-style: solid;
  border-radius: 4px;
  padding: 0;
  cursor: pointer;
}

.bpmn-properties__swatch:hover {
  transform: scale(1.08);
}

.bpmn-properties__color-inputs {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.bpmn-properties__color-input-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.bpmn-properties__color-input-label input[type="color"] {
  width: 2rem;
  height: 1.6rem;
  padding: 0;
  border: 1px solid #b7b7b7;
  border-radius: 3px;
  cursor: pointer;
}

.bpmn-properties__color-reset {
  padding: 0.3rem 0.6rem;
  border: 1px solid #b7b7b7;
  border-radius: 3px;
  background: #fff;
  font-size: 0.78rem;
  cursor: pointer;
}

.bpmn-properties__color-reset:hover {
  background: #f0f0f0;
}

.bpmn-properties__suggestions {
  position: absolute;
  z-index: 10;
  left: 0;
  right: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  background: #fff;
  border: 1px solid #b7b7b7;
  border-top: none;
  border-radius: 0 0 3px 3px;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.bpmn-properties__suggestion {
  padding: 0.4rem 0.5rem;
  cursor: pointer;
}

.bpmn-properties__suggestion:hover {
  background: #f0f0f0;
}

.bpmn-properties__suggestion--empty,
.bpmn-properties__suggestion--error {
  cursor: default;
  color: #8c8c8c;
  font-style: italic;
}

.bpmn-properties__suggestion--error:hover,
.bpmn-properties__suggestion--empty:hover {
  background: none;
}

/* "Edit diagram" link shown by BpmnViewerFormatter under a read-only
   viewer embedded in a content type's display. */
.bpmn-editor__field-edit-link {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

/* "+ Add new BPMN diagram" link added under the entity reference
   field widget on the node edit form (see hook_field_widget_single_
   element_form_alter in bpmn_editor.module). */
.bpmn-editor__add-new-link {
  margin-top: 0.35rem;
}

/* "+ Add BPMN diagram" link shown by BpmnViewerFormatter in place of the
   viewer when the field is empty (see BpmnFieldAttachController). */
.bpmn-editor__field-add-link {
  display: inline-block;
}

/* Compare-versions page (templates/bpmn-editor-diff.html.twig,
   js/bpmn-diff.js). */
.bpmn-diff__controls {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
  font-family: sans-serif;
}

.bpmn-diff__selector {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.bpmn-diff__selector label {
  font-size: 0.8rem;
  font-weight: 600;
}

.bpmn-diff__select {
  min-width: 260px;
  padding: 0.35rem 0.5rem;
  border: 1px solid #b7b7b7;
  border-radius: 3px;
}

.bpmn-diff__legend {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 0.75rem;
  font-family: sans-serif;
  font-size: 0.8rem;
}

.bpmn-diff__legend-item {
  position: relative;
  padding-left: 1.1rem;
}

.bpmn-diff__legend-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.15rem;
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 2px;
}

.bpmn-diff__legend-item--removed::before {
  background: #c0143c;
}

.bpmn-diff__legend-item--added::before {
  background: #1a7f37;
}

.bpmn-diff__legend-item--changed::before {
  background: #9a6700;
}

.bpmn-diff__legend-item--layout-changed::before {
  background: #6c757d;
}

.bpmn-diff__canvases {
  display: flex;
  gap: 1rem;
}

.bpmn-diff__pane {
  flex: 1 1 50%;
  min-width: 0;
  border: 1px solid #d4d4d4;
  border-radius: 4px;
  overflow: hidden;
}

.bpmn-diff__pane-title {
  margin: 0;
  padding: 0.5rem 0.75rem;
  background: #fafafa;
  border-bottom: 1px solid #d4d4d4;
  font-size: 0.85rem;
  font-weight: 600;
}

.bpmn-diff__canvas {
  height: 65vh;
  min-height: 400px;
  background: #fff;
}

.bpmn-diff__canvas .djs-container {
  height: 100% !important;
}

/* Diff markers (canvas.addMarker(), applied in js/bpmn-diff.js's
   applyDiffMarkers()) - same !important rationale as the retired-
   application marker above: the default renderer already sets fill/
   stroke inline, so a plain override would lose to that otherwise. */
.bpmn-diff-removed:not(.djs-connection) .djs-visual > :first-child {
  fill: #fbe3e3 !important;
  stroke: #c0143c !important;
}

.bpmn-diff-added:not(.djs-connection) .djs-visual > :first-child {
  fill: #e3f3e9 !important;
  stroke: #1a7f37 !important;
}

.bpmn-diff-changed:not(.djs-connection) .djs-visual > :first-child {
  fill: #fdf3d8 !important;
  stroke: #9a6700 !important;
}

.bpmn-diff-layout-changed:not(.djs-connection) .djs-visual > :first-child {
  fill: #eceef0 !important;
  stroke: #6c757d !important;
}

/* "What changed" detail list below the two canvases
   (templates/bpmn-editor-diff.html.twig, js/bpmn-diff.js's
   renderChangesList()) - per-property old/new values bpmn-js-differ
   provides, that colored canvas markers alone can't show. */
.bpmn-diff__changes {
  margin-top: 1.5rem;
  font-family: sans-serif;
}

.bpmn-diff__changes-title {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.bpmn-diff__changes-empty {
  color: #5c5c5c;
  font-style: italic;
  font-size: 0.85rem;
}

.bpmn-diff__changes-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.bpmn-diff__changes-item {
  padding: 0.5rem 0;
  border-bottom: 1px solid #e4e4e4;
  font-size: 0.85rem;
}

.bpmn-diff__changes-item:last-child {
  border-bottom: none;
}

.bpmn-diff__changes-attrs {
  margin: 0.25rem 0 0;
  padding-left: 1.25rem;
  color: #3a3a3a;
}
