* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f5f5f5;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: #1a1a2e;
  color: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  z-index: 100;
  flex-shrink: 0;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toolbar-left h1 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.subtitle {
  font-size: 12px;
  color: #8888aa;
  background: rgba(255,255,255,0.08);
  padding: 3px 8px;
  border-radius: 4px;
}

.toolbar-center {
  display: flex;
  align-items: center;
  gap: 4px;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.separator {
  width: 1px;
  height: 24px;
  background: rgba(255,255,255,0.15);
  margin: 0 8px;
}

button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  color: white;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s ease;
  white-space: nowrap;
}

button:hover {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.25);
}

button:active {
  transform: scale(0.97);
}

.btn-primary {
  background: #2563eb;
  border-color: #3b82f6;
  font-weight: 600;
}

.btn-primary:hover {
  background: #1d4ed8;
  border-color: #60a5fa;
}

#canvas {
  flex: 1;
  background: white;
  position: relative;
}

/* Force ALL text to black */
.djs-element .djs-visual text,
.djs-element .djs-visual tspan,
.djs-label text,
.djs-label tspan {
  fill: #000000 !important;
}

/* Shape borders/outlines always black */
.djs-shape .djs-visual > rect,
.djs-shape .djs-visual > circle,
.djs-shape .djs-visual > polygon {
  stroke: #000000 !important;
}

/* Task type icons and markers (user icon, service gear, etc.) always black */
.djs-shape .djs-visual > path {
  stroke: #000000 !important;
}

/* Inner circles of events (intermediate event inner circle, end event) - black stroke */
.djs-shape .djs-visual circle ~ circle {
  stroke: #000000 !important;
}

/* Marker paths inside events (timer, message icons) - black */
.djs-shape .djs-visual circle ~ path {
  stroke: #000000 !important;
  fill: #000000 !important;
}

/* Gateway marker (X, +, O inside diamond) - black */
.djs-shape .djs-visual polygon ~ path {
  stroke: #000000 !important;
  fill: #000000 !important;
}

/* Sequence flow lines - black */
.djs-connection .djs-visual > path {
  stroke: #000000 !important;
}

/* Arrow markers - black */
marker path {
  fill: #000000 !important;
  stroke: #000000 !important;
}

/* bpmn-js overrides */
.djs-palette {
  top: 12px !important;
  left: 12px !important;
  border-radius: 8px !important;
  border: 1px solid #e0e0e0 !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08) !important;
}

.djs-context-pad {
  border-radius: 6px;
}

/* AI Generate Panel */
.ai-gen-panel {
  position: absolute;
  top: 52px;
  left: 50%;
  transform: translateX(-50%);
  width: 560px;
  max-height: calc(100vh - 80px);
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  z-index: 200;
  overflow-y: auto;
  padding: 20px;
}

.ai-gen-panel.hidden { display: none; }

.ai-gen-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.ai-gen-header h3 { font-size: 16px; font-weight: 600; color: #1a1a2e; }

.ai-gen-close-btn {
  background: none; border: none; font-size: 22px; color: #888;
  cursor: pointer; padding: 2px 6px;
}
.ai-gen-close-btn:hover { color: #333; }

.ai-gen-subtitle { font-size: 13px; color: #666; margin-bottom: 12px; }

.ai-gen-controls {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}

.ai-gen-mic-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; background: #ef4444; color: white;
  border: none; border-radius: 8px; font-size: 13px; cursor: pointer;
}
.ai-gen-mic-btn:hover { background: #dc2626; }
.ai-gen-mic-btn.recording {
  background: #991b1b;
  animation: mic-pulse 1.5s ease-in-out infinite;
}

@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
  50% { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
}

.ai-gen-mic-indicator {
  width: 8px; height: 8px; border-radius: 50%; background: #ccc;
}
.ai-gen-mic-indicator.active { background: #ef4444; animation: mic-pulse 1s infinite; }

.ai-gen-live-btn {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 12px; background: #f5f5f5; color: #666;
  border: 1px solid #ddd; border-radius: 6px; font-size: 12px; cursor: pointer;
}
.ai-gen-live-btn.active { background: #fef2f2; color: #ef4444; border-color: #fca5a5; }
.ai-gen-live-btn.active svg { fill: #ef4444; }

.ai-gen-textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 8px;
  font-size: 13px; font-family: inherit; resize: vertical; line-height: 1.5;
}
.ai-gen-textarea:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

.ai-gen-interim {
  min-height: 20px; font-size: 13px; color: #888; font-style: italic;
  padding: 4px 0; margin-bottom: 10px;
}

.ai-gen-actions { display: flex; gap: 8px; margin-bottom: 8px; }

.ai-gen-generate-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; background: #2563eb; color: white;
  border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.ai-gen-generate-btn:hover { background: #1d4ed8; }

.ai-gen-clear-btn {
  padding: 10px 16px; background: #f5f5f5; color: #666;
  border: 1px solid #ddd; border-radius: 8px; font-size: 13px; cursor: pointer;
}
.ai-gen-clear-btn:hover { background: #e8e8e8; }

.ai-gen-status { font-size: 12px; color: #888; text-align: center; }

/* Interview Panel */
.interview-panel {
  position: absolute;
  top: 52px; right: 0;
  width: 420px; height: calc(100vh - 80px);
  background: white; border-left: 1px solid #e0e0e0;
  box-shadow: -4px 0 16px rgba(0,0,0,0.06);
  z-index: 200; display: flex; flex-direction: column;
}
.interview-panel.hidden { display: none; }

.interview-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 12px 16px; border-bottom: 1px solid #eee; flex-shrink: 0;
}
.interview-header h3 { font-size: 15px; font-weight: 600; color: #1a1a2e; margin: 0; }
.interview-header-actions { display: flex; align-items: center; gap: 8px; }

.interview-phase {
  display: inline-block; font-size: 11px; color: #2563eb; background: #eff6ff;
  padding: 2px 8px; border-radius: 10px; margin-top: 4px;
}

.interview-tts-label {
  font-size: 11px; color: #888; display: flex; align-items: center; gap: 4px; cursor: pointer;
}

.interview-messages {
  flex: 1; overflow-y: auto; padding: 12px 16px;
  display: flex; flex-direction: column; gap: 10px;
}

.interview-msg { font-size: 13px; line-height: 1.5; padding: 8px 12px; border-radius: 8px; }
.interview-msg-header { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.interview-msg strong { font-size: 11px; }
.interview-msg-ai { background: #f0f4ff; color: #333; }
.interview-msg-ai strong { color: #2563eb; }

.interview-play-btn {
  background: none; border: none; color: #2563eb; cursor: pointer;
  font-size: 12px; padding: 1px 4px; border-radius: 4px; line-height: 1;
}
.interview-play-btn:hover { background: #e0e7ff; }

.interview-pause-btn {
  background: none; border: none; color: #ef4444; cursor: pointer;
  font-size: 11px; padding: 1px 4px; border-radius: 4px; line-height: 1; letter-spacing: -2px;
}
.interview-pause-btn:hover { background: #fef2f2; }

.interview-load-row {
  display: flex; gap: 4px; padding: 4px 16px 8px; align-items: center; flex-shrink: 0; flex-wrap: wrap;
}
.interview-load-row select {
  flex: 1; min-width: 0; padding: 5px 6px; border: 1px solid #ddd; border-radius: 6px;
  font-size: 11px; font-family: inherit; background: white;
}
.interview-load-row button {
  padding: 5px 8px; font-size: 11px; white-space: nowrap; flex-shrink: 0;
}

.interview-mic-status {
  font-size: 11px; color: #ef4444; text-align: center; padding: 2px 16px;
  animation: mic-pulse 1.5s ease-in-out infinite;
}
.interview-mic-status.hidden { display: none; }
.interview-msg-user { background: #f5f5f5; color: #333; }
.interview-msg-user strong { color: #666; }

.interview-typing {
  padding: 8px 16px; font-size: 12px; color: #888;
  display: flex; align-items: center; gap: 4px;
}
.interview-typing.hidden { display: none; }
.interview-typing span {
  width: 6px; height: 6px; border-radius: 50%; background: #bbb;
  animation: typing-dot 1.2s infinite;
}
.interview-typing span:nth-child(2) { animation-delay: 0.2s; }
.interview-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-dot {
  0%, 100% { opacity: 0.3; } 50% { opacity: 1; }
}

.interview-input-row {
  display: flex; gap: 6px; padding: 10px 16px; border-top: 1px solid #eee; flex-shrink: 0;
}
.interview-input-row textarea {
  flex: 1; padding: 8px 10px; border: 1px solid #ddd; border-radius: 6px;
  font-size: 13px; font-family: inherit; resize: none; line-height: 1.4;
}
.interview-input-row textarea:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37,99,235,0.1); }

.interview-send-btn {
  padding: 8px 14px; background: #2563eb; color: white;
  border: none; border-radius: 6px; font-size: 13px; cursor: pointer;
}
.interview-send-btn:hover { background: #1d4ed8; }

.interview-bottom-actions {
  padding: 8px 16px; border-top: 1px solid #eee; flex-shrink: 0;
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
}
.interview-bottom-actions .hidden { display: none; }

.interview-validate-btn {
  padding: 8px 14px; background: #f59e0b; color: white;
  border: none; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.interview-validate-btn:hover { background: #d97706; }

/* Properties toggle button */
.properties-toggle {
  position: absolute;
  top: 62px;
  right: 12px;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: white;
  border: 1px solid #ddd;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  color: #555;
  padding: 0;
  transition: all 0.15s;
}

.properties-toggle:hover {
  background: #f0f0f0;
  color: #333;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.properties-toggle.active {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}

.properties-panel {
  position: absolute;
  top: 52px;
  right: 0;
  width: 320px;
  height: calc(100vh - 52px - 28px);
  background: white;
  border-left: 1px solid #e0e0e0;
  box-shadow: -4px 0 16px rgba(0,0,0,0.06);
  z-index: 50;
  display: none;
  flex-direction: column;
  overflow-y: auto;
}

.properties-panel.open {
  display: flex;
}

.properties-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #e8e8e8;
  background: #fafafa;
}

.properties-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.properties-header button {
  background: none;
  border: none;
  color: #666;
  font-size: 20px;
  padding: 2px 6px;
  cursor: pointer;
}

.properties-header button:hover {
  color: #333;
  background: #eee;
  border-radius: 4px;
}

#properties-content {
  padding: 16px;
}

#properties-content .prop-group {
  margin-bottom: 16px;
}

#properties-content label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #555;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#properties-content input,
#properties-content textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.15s;
}

#properties-content input:focus,
#properties-content textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

#properties-content textarea {
  resize: vertical;
  min-height: 200px;  /* ~10 regels — groeit auto via JS bij meer tekst */
  line-height: 1.5;
}

#properties-content .prop-type {
  display: inline-block;
  font-size: 11px;
  color: #888;
  background: #f0f0f0;
  padding: 2px 8px;
  border-radius: 10px;
  margin-bottom: 12px;
}

.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 16px;
  background: #1a1a2e;
  color: #8888aa;
  font-size: 12px;
  flex-shrink: 0;
}

#element-count {
  font-variant-numeric: tabular-nums;
}

.toast {
  position: fixed;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1a1a2e;
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.success {
  border-left: 4px solid #22c55e;
}

.toast.error {
  border-left: 4px solid #ef4444;
}

.toast.info {
  border-left: 4px solid #3b82f6;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  border-radius: 12px;
  padding: 24px;
  width: 420px;
  max-width: 90vw;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.modal-content h3 {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 8px;
}

.modal-content p {
  font-size: 13px;
  color: #666;
  margin-bottom: 16px;
}

.modal-content input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  margin-bottom: 16px;
}

.modal-content input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.modal-buttons button {
  color: #333;
  background: #f0f0f0;
  border: 1px solid #ddd;
}

.modal-buttons button:hover {
  background: #e0e0e0;
}

.modal-buttons .btn-primary {
  background: #2563eb;
  border-color: #3b82f6;
  color: white;
}

.modal-buttons .btn-primary:hover {
  background: #1d4ed8;
}

/* Color controls in properties panel */
.color-row {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
}

.color-field {
  flex: 1;
}

.color-field label {
  font-size: 11px !important;
  text-transform: none !important;
  margin-bottom: 2px;
}

.color-field input[type="color"] {
  width: 100%;
  height: 32px;
  padding: 2px;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  background: white;
}

.color-presets {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.color-preset {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #ccc;
  cursor: pointer;
  padding: 0;
  transition: transform 0.1s;
}

.color-preset:hover {
  transform: scale(1.15);
  border-color: #888;
}

.color-preset.remove-mode {
  outline: 2px solid #ef4444;
  outline-offset: 1px;
  cursor: not-allowed;
}

.color-preset-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.preset-action-btn {
  flex: 1;
  padding: 4px 8px;
  font-size: 11px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #f5f5f5;
  color: #333;
  cursor: pointer;
}

.preset-action-btn:hover {
  background: #e8e8e8;
}

.preset-remove-btn.active {
  background: #fef2f2;
  border-color: #ef4444;
  color: #ef4444;
}

/* Stencil dropdown */
.stencil-dropdown {
  position: relative;
}

.stencil-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: #1a1a2e;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  z-index: 200;
  overflow: hidden;
  min-width: 180px;
}

.stencil-menu.hidden {
  display: none;
}

.stencil-option {
  display: block;
  width: 100%;
  padding: 9px 14px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: white;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.stencil-option:hover {
  background: rgba(255,255,255,0.12);
}

.stencil-save {
  color: #60a5fa;
  font-weight: 600;
}

.stencil-reset {
  color: #aaa;
}

.stencil-divider {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 2px 0;
}

.stencil-item {
  display: flex;
  align-items: center;
}

.stencil-item .stencil-apply {
  flex: 1;
}

.stencil-delete {
  background: none;
  border: none;
  color: #888;
  font-size: 18px;
  padding: 4px 10px;
  cursor: pointer;
  border-radius: 0;
}

.stencil-delete:hover {
  color: #ef4444;
  background: rgba(239,68,68,0.1);
}

/* Flow Walker */
.walker-panel {
  position: fixed;
  bottom: 28px;
  left: 0;
  right: 0;
  background: #1a1a2e;
  color: white;
  padding: 12px 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  z-index: 500;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
}

.walker-panel.hidden {
  display: none;
}

.walker-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.walker-controls button {
  padding: 6px 8px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.walker-controls button:hover {
  background: rgba(255,255,255,0.15);
}

.walker-play-btn {
  background: #2563eb !important;
  border-color: #3b82f6 !important;
}

.walker-counter {
  font-size: 12px;
  color: #8888aa;
  margin-left: 8px;
  font-variant-numeric: tabular-nums;
}

.walker-voice-indicator {
  margin-left: 8px;
}

.walker-subtitle-area {
  flex: 1;
  min-width: 0;
}

.walker-subtitle {
  font-size: 15px;
  line-height: 1.5;
  color: #e0e0e0;
  padding: 4px 0;
}

.walker-edit {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
  color: white;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  margin-top: 6px;
}

.walker-edit:focus {
  outline: none;
  border-color: #2563eb;
}

.walker-edit.hidden {
  display: none;
}

.walker-edit-controls {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.walker-small-btn {
  padding: 3px 10px;
  font-size: 11px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  background: rgba(255,255,255,0.08);
  color: #aaa;
  cursor: pointer;
}

.walker-small-btn:hover {
  background: rgba(255,255,255,0.15);
  color: white;
}

.walker-small-btn.hidden {
  display: none;
}

.walker-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  color: #888;
  font-size: 20px;
  cursor: pointer;
  padding: 2px 6px;
}

.walker-close:hover {
  color: white;
}

/* Highlight overlay for current walker element */
.walker-highlight {
  border: 3px solid #2563eb;
  border-radius: 8px;
  background: rgba(37,99,235,0.08);
  pointer-events: none;
  animation: walker-pulse 1.5s ease-in-out infinite;
}

@keyframes walker-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37,99,235,0.3); }
  50% { box-shadow: 0 0 12px 4px rgba(37,99,235,0.2); }
}
