* {
  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 — full-screen modal
   Structuur:
     .ai-gen-hero (gradient banner met titel/uitleg)
     .ai-gen-body (flex:1, scrollable, controls + textarea + suggesties + tips)
     .ai-gen-footer (generate-knop + status)
   ============================================================ */
.ai-gen-panel {
  /* FlowTopper-huisstijl tokens — VAST (niet per-klant gethematiseerd, afspraak Remco 27-6) */
  --ftg-green: #02FC75;
  --ftg-green-deep: #00C95C;
  --ftg-green-ink: #06281A;
  --ftg-green-soft: #E7FEF1;
  --ftg-green-line: #9DF4C4;
  --ftg-indigo: #3214CB;
  --ftg-indigo-soft: #EEF0FF;
  --ftg-track: #EAEEF3;
  --ftg-ink: #0F1633;
  --ftg-muted: #64748B;
  --ftg-line: #E6E9F2;
  font-family: 'Outfit', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-height: none;
  transform: none;
  background: #F4F6FB;
  border-radius: 0;
  box-shadow: none;
  z-index: 1500;
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
  animation: ai-gen-fade-in 0.22s ease-out;
}

.ai-gen-panel.hidden { display: none; }

@keyframes ai-gen-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes ai-gen-slide-up {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* --- TOPBAR (witte kop met FlowTopper-logo; vervangt de paarse hero) --- */
.ai-gen-topbar {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 13px clamp(20px, 4vw, 44px);
  background: #fff;
  border-bottom: 1px solid var(--ftg-line);
}
.ai-gen-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.ai-gen-brand-logo { width: 30px; height: 34px; display: block; }
.ai-gen-brand-word {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: #111111;        /* (AI) en Topper zwart (Remco 27-6); alleen "Flow" groen */
  white-space: nowrap;
}
.ai-gen-brand-word .ai-gen-flow { color: var(--ftg-green); }
.ai-gen-topbar-div { width: 1px; height: 34px; background: var(--ftg-line); flex-shrink: 0; }
.ai-gen-topbar-head { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ai-gen-topbar-head h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--ftg-indigo);
  margin: 0;
  letter-spacing: -0.2px;
}
.ai-gen-topbar-head .ai-gen-subtitle {
  font-size: 13px;
  color: var(--ftg-muted);
  margin: 0;
  line-height: 1.35;
}
.ai-gen-panel .ai-gen-close-btn {
  margin-left: auto;
  width: 34px;
  height: 34px;
  background: #fff;
  border: 1px solid var(--ftg-line);
  border-radius: 999px;
  color: #64748B;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.ai-gen-panel .ai-gen-close-btn:hover {
  background: #F1F3F9;
  color: #0F1633;
  border-color: #CBD5E1;
}

/* --- BODY --- */
.ai-gen-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px clamp(24px, 6vw, 80px) 8px;
  overflow-y: auto;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* --- "Nieuw interview"-kaart: schakelaar (segmented control) + panes --- */
.iv-seg {
  display: inline-flex;
  gap: 6px;
  background: #f1f3f7;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 5px;
  margin: 12px 0 18px;
  flex-wrap: wrap;
}
.iv-seg-btn {
  border: none;
  background: transparent;
  border-radius: 9px;
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background .14s ease, color .14s ease, box-shadow .14s ease;
}
.iv-seg-btn:hover { color: #111827; }
.iv-seg-btn.active {
  background: #fff;
  color: var(--primary, #3300ff);
  box-shadow: 0 1px 3px rgba(16, 24, 40, .12);
}
.iv-seg-ico { font-size: 16px; line-height: 1; }
.iv-pane[hidden] { display: none; }
.iv-pane-self {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.iv-pane-self p { margin: 0; color: var(--text-light, #6b7280); font-size: 13.5px; }
/* Procesnaam-veld vergrendeld (uitgegrijsd) zodra aan een proces is gekoppeld.
   !important omdat een specifiekere basis-inputregel anders de achtergrond wint. */
#assignment-form input:disabled,
#assignment-form input.is-locked {
  background: #f1f5f9 !important;
  color: #64748b !important;
  cursor: not-allowed !important;
  opacity: 1;
}

/* --- CONTROLS (inspreken + live + live-status) --- */
.ai-gen-panel .ai-gen-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0;
}
.ai-gen-panel .ai-gen-mic-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: #fff;
  color: var(--ftg-ink);
  border: 1.5px solid var(--ftg-line);
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.ai-gen-panel .ai-gen-mic-btn svg { color: var(--ftg-muted); }
.ai-gen-panel .ai-gen-mic-btn:hover { border-color: #CBD5E1; background: #FAFBFE; }
.ai-gen-panel .ai-gen-mic-btn.recording {
  background: var(--ftg-green-soft);
  border-color: var(--ftg-green);
  color: var(--ftg-green-ink);
}
.ai-gen-panel .ai-gen-mic-btn.recording svg { color: var(--ftg-green-deep); }
/* "Upload Word of PDF" — zelfde pill-stijl als Inspreken (FlowTopper-huisstijl). */
.ai-gen-panel .ai-gen-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: #fff;
  color: var(--ftg-ink);
  border: 1.5px solid var(--ftg-line);
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.ai-gen-panel .ai-gen-upload-btn svg { color: var(--ftg-muted); }
.ai-gen-panel .ai-gen-upload-btn:hover { border-color: #CBD5E1; background: #FAFBFE; }
.ai-gen-panel .ai-gen-upload-btn.busy { opacity: .65; cursor: progress; }
/* Fase B — opknip-/keuze-paneel (FlowTopper-huisstijl). */
.ai-gen-split-overlay {
  position: fixed; inset: 0; z-index: 2147483000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15, 23, 42, .45); padding: 24px;
}
.ai-gen-split-modal {
  background: #fff; border-radius: 16px; max-width: 900px; width: 100%;
  max-height: 90vh; overflow: auto; padding: 22px 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25); font-family: inherit;
}
.ai-gen-split-head { display: flex; align-items: flex-start; gap: 12px; }
.ai-gen-split-icon {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  background: #EEF2FF;
}
.ai-gen-split-head-text { flex: 1; }
.ai-gen-split-head h3 { margin: 0 0 4px; font-size: 17px; color: var(--ftg-ink, #111827); line-height: 1.3; }
.ai-gen-split-head p { margin: 0; font-size: 13px; color: var(--ftg-muted, #6b7280); }
.ai-gen-split-close {
  background: none; border: none; font-size: 24px; line-height: 1; cursor: pointer;
  color: var(--ftg-muted, #6b7280); padding: 0 4px;
}
.ai-gen-split-bp { margin: 14px 0 10px; font-size: 13px; color: var(--ftg-muted, #6b7280); }
.ai-gen-split-bp strong { color: #3D2EFF; }
.ai-gen-split-cards { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; }
.ai-gen-split-card {
  flex: 1 1 200px; min-width: 180px; display: flex; gap: 10px;
  border: 1.5px solid var(--ftg-line, #e5e7eb); border-radius: 12px; padding: 12px;
  background: #FAFBFE;
}
.ai-gen-split-num {
  flex: 0 0 24px; width: 24px; height: 24px; border-radius: 999px;
  background: #3D2EFF; color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.ai-gen-split-card-body { display: flex; flex-direction: column; gap: 3px; }
.ai-gen-split-card-body strong { font-size: 13px; color: var(--ftg-ink, #111827); }
.ai-gen-split-steps { font-size: 11px; color: #3D2EFF; font-weight: 600; }
.ai-gen-split-desc { font-size: 11px; color: var(--ftg-muted, #6b7280); line-height: 1.35; }
.ai-gen-split-arrow { align-self: center; color: #9ca3af; font-size: 16px; }
.ai-gen-split-vragen {
  margin-top: 14px; padding: 12px; border-radius: 12px;
  background: #FFF7ED; border: 1px solid #FED7AA;
}
.ai-gen-split-vragen-title { font-size: 13px; font-weight: 600; color: #9A3412; margin-bottom: 8px; }
.ai-gen-split-vraag { display: block; font-size: 12px; color: #7C2D12; margin-bottom: 8px; }
.ai-gen-split-vraag span { display: block; margin-bottom: 3px; }
.ai-gen-split-vraag input {
  width: 100%; padding: 7px 10px; border: 1px solid #FDBA74; border-radius: 8px;
  font-family: inherit; font-size: 13px; box-sizing: border-box;
}
.ai-gen-split-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 18px; }
.ai-gen-split-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ftg-muted, #6b7280); cursor: pointer; }
/* Fase C — bouw-voortgang + resultatenlijst met voorbeeld. */
.ai-gen-fasec-steps { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.ai-gen-fasec-step {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1.5px solid var(--ftg-line, #e5e7eb); border-radius: 12px; background: #FAFBFE;
}
.ai-gen-fasec-step[data-status="klaar"] { border-color: #86efac; background: #f0fdf4; }
.ai-gen-fasec-step[data-status="fout"] { border-color: #fca5a5; background: #fef2f2; }
.ai-gen-fasec-step-ico { flex: 0 0 20px; text-align: center; font-size: 14px; }
.ai-gen-fasec-step-naam { flex: 1; font-size: 13px; font-weight: 600; color: var(--ftg-ink, #111827); }
.ai-gen-fasec-step-sub { font-size: 11px; color: var(--ftg-muted, #6b7280); }
.ai-gen-fasec-result { max-width: 1080px; }
.ai-gen-fasec-layout { display: grid; grid-template-columns: 260px 1fr; gap: 14px; margin-top: 14px; }
@media (max-width: 760px) { .ai-gen-fasec-layout { grid-template-columns: 1fr; } }
.ai-gen-fasec-list { display: flex; flex-direction: column; gap: 8px; max-height: 62vh; overflow: auto; }
.ai-gen-fasec-card {
  text-align: left; display: flex; flex-direction: column; gap: 3px; cursor: pointer;
  border: 1.5px solid var(--ftg-line, #e5e7eb); border-radius: 12px; padding: 10px 12px;
  background: #fff; font-family: inherit;
}
.ai-gen-fasec-card:hover { border-color: #CBD5E1; background: #FAFBFE; }
.ai-gen-fasec-card.active { border-color: #3D2EFF; background: #EEF2FF; }
.ai-gen-fasec-card.fout { opacity: .8; cursor: pointer; }
.ai-gen-fasec-card.fout:hover { border-color: #CBD5E1; background: #FAFBFE; opacity: 1; }
.ai-gen-fasec-card-type { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: #3D2EFF; font-weight: 700; }
.ai-gen-fasec-card strong { font-size: 13px; color: var(--ftg-ink, #111827); }
.ai-gen-fasec-card-status { font-size: 11px; color: var(--ftg-muted, #6b7280); }
.ai-gen-fasec-preview { display: flex; flex-direction: column; gap: 10px; }
.ai-gen-fasec-viewer {
  flex: 1; min-height: 380px; height: 62vh; border: 1.5px solid var(--ftg-line, #e5e7eb);
  border-radius: 12px; background: #fff; overflow: hidden;
}
.ai-gen-fasec-preview-actions { display: flex; align-items: center; gap: 12px; }
.ai-gen-fasec-preview-name { font-size: 13px; font-weight: 600; color: var(--ftg-ink, #111827); }
/* Fase C — vaste schemabalk (wisselen tussen gegenereerde schema's in Bewerken). */
#ai-gen-schemabalk {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 74px; z-index: 2147482000;
  display: flex; align-items: center; gap: 10px; max-width: 94vw;
  padding: 8px 12px; background: #fff; border: 1.5px solid var(--ftg-line, #e5e7eb);
  border-radius: 999px; box-shadow: 0 8px 30px rgba(0, 0, 0, .18); font-family: inherit;
}
#ai-gen-schemabalk .ai-gen-schemabalk-label { font-size: 12px; font-weight: 700; color: var(--ftg-muted, #6b7280); white-space: nowrap; }
#ai-gen-schemabalk .ai-gen-schemabalk-chips { display: flex; gap: 6px; overflow-x: auto; max-width: 64vw; }
#ai-gen-schemabalk .ai-gen-schemabalk-chip {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 6px 12px; border: 1.5px solid var(--ftg-line, #e5e7eb); border-radius: 999px;
  background: #fff; color: var(--ftg-ink, #111827); font-family: inherit; font-size: 12.5px;
  font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
#ai-gen-schemabalk .ai-gen-schemabalk-chip:hover { border-color: #CBD5E1; background: #FAFBFE; }
#ai-gen-schemabalk .ai-gen-schemabalk-chip.active { border-color: #3D2EFF; background: #EEF2FF; color: #3D2EFF; }
#ai-gen-schemabalk .ai-gen-schemabalk-chip.fout { border-color: #F59E0B; background: #FFFBEB; color: #B45309; }
#ai-gen-schemabalk .ai-gen-schemabalk-chip.fout.active { border-color: #D97706; background: #FEF3C7; color: #92400E; }
#ai-gen-schemabalk .ai-gen-schemabalk-type { opacity: .8; }
#ai-gen-schemabalk .ai-gen-schemabalk-overview {
  white-space: nowrap; padding: 6px 12px; border: none; border-radius: 999px;
  background: #3D2EFF; color: #fff; font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
#ai-gen-schemabalk .ai-gen-schemabalk-close {
  background: none; border: none; font-size: 20px; line-height: 1; cursor: pointer; color: var(--ftg-muted, #6b7280); padding: 0 2px;
}
.ai-gen-panel .ai-gen-live-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #fff;
  color: var(--ftg-muted);
  border: 1.5px solid var(--ftg-line);
  border-radius: 999px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.ai-gen-panel .ai-gen-live-btn svg { fill: #CBD5E1; }
.ai-gen-panel .ai-gen-live-btn:hover {
  border-color: #CBD5E1;
  color: #334155;
}
.ai-gen-panel .ai-gen-live-btn.active {
  background: var(--ftg-green-soft);
  color: var(--ftg-green-ink);
  border-color: var(--ftg-green);
}
.ai-gen-panel .ai-gen-live-btn.active svg { fill: var(--ftg-green-deep); }

/* Rechterkant van de controls-rij: één status tegelijk (hint / luisteren / compleet) */
.ai-gen-controls-status { margin-left: auto; display: flex; align-items: center; min-height: 24px; }
.ai-gen-controls-hint {
  font-size: 13px;
  color: #94A3B8;
  font-weight: 500;
}
.ai-gen-controls-hint[hidden] { display: none; }

/* Luister-status: groene geluidsbalkjes + tekst + tijdteller (alleen tijdens opnemen) */
.ai-gen-listen { display: inline-flex; align-items: center; gap: 11px; }
.ai-gen-listen[hidden] { display: none; }
.ai-gen-listen-text { font-size: 13px; font-weight: 600; color: #334155; white-space: nowrap; }
.ai-gen-listen-timer { font-size: 13px; font-weight: 700; color: var(--ftg-muted); font-variant-numeric: tabular-nums; }
.ai-gen-wave { display: inline-flex; align-items: flex-end; gap: 2px; height: 22px; }
.ai-gen-wave i {
  width: 3px; height: 30%; border-radius: 2px;
  background: var(--ftg-green);
  animation: ai-gen-wave .9s ease-in-out infinite alternate;
}
@keyframes ai-gen-wave { from { height: 14%; } to { height: 92%; } }
.ai-gen-wave i:nth-child(1)  { animation-delay: -.20s; }
.ai-gen-wave i:nth-child(2)  { animation-delay: -.56s; animation-duration: 1.0s; }
.ai-gen-wave i:nth-child(3)  { animation-delay: -.86s; }
.ai-gen-wave i:nth-child(4)  { animation-delay: -.34s; animation-duration: .8s; }
.ai-gen-wave i:nth-child(5)  { animation-delay: -.70s; }
.ai-gen-wave i:nth-child(6)  { animation-delay: -.10s; animation-duration: 1.1s; }
.ai-gen-wave i:nth-child(7)  { animation-delay: -.50s; }
.ai-gen-wave i:nth-child(8)  { animation-delay: -.92s; animation-duration: .85s; }
.ai-gen-wave i:nth-child(9)  { animation-delay: -.28s; }
.ai-gen-wave i:nth-child(10) { animation-delay: -.64s; animation-duration: 1.05s; }
.ai-gen-wave i:nth-child(11) { animation-delay: -.16s; }
.ai-gen-wave i:nth-child(12) { animation-delay: -.78s; animation-duration: .82s; }
.ai-gen-wave i:nth-child(13) { animation-delay: -.42s; }
.ai-gen-wave i:nth-child(14) { animation-delay: -.60s; animation-duration: 1.08s; }

/* Compleet-indicator na opnemen */
.ai-gen-done { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--ftg-green-deep); white-space: nowrap; }
.ai-gen-done[hidden] { display: none; }
.ai-gen-done svg { width: 16px; height: 16px; color: var(--ftg-green-deep); }

/* --- TEXTAREA (met live-badge rechtsboven) --- */
.ai-gen-textarea-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  width: 100%;
}
.ai-gen-panel .ai-gen-textarea {
  flex: 1;
  min-height: 0;
  height: auto;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  resize: none;
  font-size: 15px;
  line-height: 1.6;
  padding: 18px 22px;
  border: 1.5px solid var(--ftg-line);
  border-radius: 14px;
  background: white;
  color: var(--ftg-ink);
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(15,23,42,0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ai-gen-panel .ai-gen-textarea::placeholder { color: #9AA3B5; }
.ai-gen-panel .ai-gen-textarea:focus {
  outline: none;
  border-color: var(--ftg-indigo);
  box-shadow: 0 0 0 4px rgba(50,20,203,0.10);
}
/* Actief (opnemen óf tekst aanwezig) → groene rand, zoals de animatie */
.ai-gen-textarea-wrap.is-recording .ai-gen-textarea,
.ai-gen-textarea-wrap.has-text .ai-gen-textarea {
  border-color: var(--ftg-green);
  box-shadow: 0 0 0 4px rgba(2,252,117,0.14);
}
/* Badge rechtsboven in het tekstvak: LIVE TRANSCRIPTIE / COMPLEET */
.ai-gen-ta-badge {
  position: absolute;
  top: 12px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px 4px 9px;
  background: var(--ftg-green-soft);
  border: 1px solid var(--ftg-green-line);
  color: var(--ftg-green-deep);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  pointer-events: none;
}
.ai-gen-ta-badge[hidden] { display: none; }
.ai-gen-ta-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ftg-green); flex: none; }
.ai-gen-ta-badge.is-live .dot { animation: ai-gen-blink 1s ease-in-out infinite; }
@keyframes ai-gen-blink { 50% { opacity: 0.25; } }
.ai-gen-ta-badge .chk { width: 13px; height: 13px; flex: none; display: none; }
.ai-gen-ta-badge.is-done .dot { display: none; }
.ai-gen-ta-badge.is-done .chk { display: inline-block; }

/* Laad-overlay tijdens genereren: ronddraaiend robotje + voortgangsbalk */
.ai-gen-loading {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: rgba(246,247,251,0.94);
}
.ai-gen-loading.hidden { display: none; }
.ai-gen-loading p { font-size: 18px; font-weight: 600; color: #3300ff; margin: 0; }
.ai-gen-robot {
  width: 56px; height: 56px; margin: 0 auto;
  background: url('../logo-icoon.svg') center / contain no-repeat;
  animation: ai-gen-robot-spin 2s linear infinite;
}
@keyframes ai-gen-robot-spin { to { transform: rotate(360deg); } }
/* Procesmodel-generatie: zelfde ronddraaiend logo als de AI-tekst-generator (consistentie). */
.processmodel-progress-robot {
  width: 46px; height: 46px; margin: 0 auto 4px;
  background: url('../logo-icoon.svg') center / contain no-repeat;
  animation: ai-gen-robot-spin 2s linear infinite;
}
.ai-gen-progress-track {
  width: 280px; height: 8px; border-radius: 999px;
  background: rgba(51,0,255,0.12); overflow: hidden;
}
.ai-gen-progress-fill {
  height: 100%; width: 0%; border-radius: 999px;
  background: #3300ff; transition: width 0.3s ease;
}
.ai-gen-progress-pct { font-size: 13px; font-weight: 700; color: #3300ff; }

/* Preview-staat na genereren */
.ai-gen-body.hidden, .ai-gen-footer.hidden { display: none; }
.ai-gen-preview {
  flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 14px;
  padding: 14px 28px 20px; width: 100%; max-width: none; margin: 0;
}
.ai-gen-preview.hidden { display: none; }
.ai-gen-preview-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ai-gen-preview-title strong { display: block; font-size: 18px; font-weight: 700; color: var(--ftg-indigo); letter-spacing: -0.2px; }
.ai-gen-preview-title span { font-size: 13px; color: var(--ftg-muted); }
.ai-gen-preview-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* "Pas tekst aan" = rustige (ghost) knop naast de groene Doorgaan-knop */
.ai-gen-panel .ai-gen-ghost-btn {
  padding: 9px 16px; background: #fff; color: var(--ftg-ink);
  border: 1.5px solid var(--ftg-line); border-radius: 10px;
  font-family: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: all .15s;
}
.ai-gen-panel .ai-gen-ghost-btn:hover { border-color: #CBD5E1; background: #FAFBFE; }
/* Doorgaan-knop in de balk compacter dan de hoofd-Genereer-knop */
.ai-gen-preview-actions .ai-gen-generate-btn { flex: 0 0 auto; max-width: none; padding: 10px 18px; font-size: 13.5px; }
.ai-gen-preview-svg {
  flex: 1; min-height: 0; overflow: hidden; background: white; position: relative;
  border: 2px solid #e2e8f0; border-radius: 14px; padding: 6px;
}
/* Live preview (bpmn-js viewer) moet de holder vullen zodat fit-viewport goed schaalt. */
.ai-gen-preview-svg .djs-container { width: 100% !important; height: 100% !important; }

/* Fase 3b-layout: schema-paneel + versleepbare splitter + vragen-paneel */
.ai-gen-werk { flex: 1; min-height: 0; display: flex; flex-direction: row; align-items: stretch; }
.ai-gen-werk.is-kolom { flex-direction: column; }
.ai-gen-schemapaneel { flex: 0 0 62%; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.ai-gen-zoombar { display: flex; align-items: center; gap: 6px; padding: 0 0 8px; }
.ai-gen-zoombar button {
  width: 30px; height: 30px; border: 1px solid #cbd5e1; background: #fff; border-radius: 8px;
  font-size: 16px; font-weight: 700; line-height: 1; cursor: pointer; color: #334155;
}
.ai-gen-zoombar button:hover { background: #f1f5f9; }
.ai-gen-zoom-hint { font-size: 11px; color: #94a3b8; margin-left: 8px; }
.ai-gen-splitter { flex: 0 0 12px; cursor: col-resize; position: relative; }
.ai-gen-splitter::before { content: ''; position: absolute; left: 5px; top: 0; bottom: 0; width: 2px; background: #e2e8f0; border-radius: 2px; }
.ai-gen-splitter:hover::before { background: #94a3b8; }
.ai-gen-werk.is-kolom .ai-gen-splitter { flex-basis: 12px; cursor: row-resize; }
.ai-gen-werk.is-kolom .ai-gen-splitter::before { left: 0; right: 0; top: 5px; bottom: auto; width: auto; height: 2px; }
.ai-gen-splitter.hidden { display: none; }
.ai-gen-layout-seg { display: inline-flex; border: 1px solid var(--ftg-line); border-radius: 10px; overflow: hidden; margin-right: 8px; background: #F4F6FB; padding: 2px; gap: 2px; }
.ai-gen-layout-seg button { border: 0; background: transparent; color: var(--ftg-muted); font-family: inherit; font-size: 12.5px; font-weight: 600; padding: 6px 12px; cursor: pointer; border-radius: 8px; transition: all .15s; }
.ai-gen-layout-seg button:hover { color: var(--ftg-ink); }
.ai-gen-layout-seg button.active { background: var(--ftg-indigo); color: #fff; }
.ai-gen-preview-svg > svg { max-width: 100%; max-height: 100%; width: auto; height: auto; display: block; margin: 0 auto; }
/* Live preview = bpmn-js modeler; verberg de edit-chrome (palette/context-pad) zodat het een
   nette preview blijft. */
.ai-gen-preview-svg .djs-palette,
.ai-gen-preview-svg .djs-context-pad,
.ai-gen-preview-svg .djs-popup { display: none !important; }

/* Fase 3b: vragen-paneel naast/onder het schema — FlowTopper-huisstijl */
.ai-gen-vragen {
  flex: 1 1 0; min-width: 0; min-height: 0; overflow: auto;
  display: flex; flex-direction: column; gap: 14px;
  background: #fff; border: 1px solid var(--ftg-line); border-radius: 16px; padding: 18px;
}
.ai-gen-vragen.hidden { display: none; }
.ai-gen-vragen-kop { display: flex; align-items: flex-start; gap: 12px; }
.ai-gen-vragen-icon {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ftg-indigo-soft); color: var(--ftg-indigo); font-size: 16px; font-weight: 800;
}
.ai-gen-vragen-koptekst strong { display: block; font-size: 16px; font-weight: 700; color: var(--ftg-ink); }
.ai-gen-vragen-koptekst span { display: block; font-size: 13px; color: var(--ftg-muted); margin-top: 2px; line-height: 1.4; }

/* Voortgang: "AI denkt mee"-pill + X/Y beantwoord + groene balk die meegroeit */
.ai-gen-vragen-voortgang { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ai-gen-denktmee {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--ftg-green-soft); border: 1px solid var(--ftg-green-line); color: var(--ftg-green-ink);
  border-radius: 999px; padding: 4px 12px 4px 10px; font-size: 12.5px; font-weight: 700;
}
.ai-gen-denktmee .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ftg-green); animation: ai-gen-blink 1.2s ease-in-out infinite; }
.ai-gen-vragen-teller { font-size: 13px; font-weight: 600; color: var(--ftg-muted); }
.ai-gen-vragen-balk { flex-basis: 100%; height: 8px; border-radius: 999px; background: var(--ftg-track); overflow: hidden; }
.ai-gen-vragen-balk-fill { height: 100%; width: 0%; border-radius: 999px; background: var(--ftg-green); transition: width .35s ease; }

.ai-gen-vragen-lijst { display: flex; flex-direction: column; gap: 12px; }
.ai-gen-vraag {
  display: flex; flex-direction: column; gap: 8px;
  background: #fff; border: 1.5px solid var(--ftg-line); border-radius: 12px; padding: 13px 14px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.ai-gen-vraag.is-beantwoord { border-color: var(--ftg-green-line); background: var(--ftg-green-soft); }
/* Klikbare kaart: duidelijke pointer + hover-accent zodat zichtbaar is dat je 'm kunt aanklikken (Remco 27-6) */
.ai-gen-vraag.is-klikbaar { cursor: pointer; }
.ai-gen-vraag.is-klikbaar:hover { border-color: var(--ftg-indigo); box-shadow: 0 3px 12px rgba(50,20,203,.12); }
.ai-gen-vraag.is-klikbaar.is-beantwoord:hover { border-color: var(--ftg-green); box-shadow: 0 3px 12px rgba(2,252,117,.18); }
.ai-gen-vraag-input { cursor: text; }
.ai-gen-vraag-head { display: flex; align-items: center; }
/* "toon in schema"-hint rechts in de kaartkop */
.ai-gen-vraag-locate {
  margin-left: auto; display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; color: var(--ftg-muted); white-space: nowrap; flex: 0 0 auto;
}
.ai-gen-vraag-locate svg { opacity: .85; }
.ai-gen-vraag.is-klikbaar:hover .ai-gen-vraag-locate { color: var(--ftg-indigo); }
.ai-gen-vraag-tekst { font-size: 14px; font-weight: 600; color: var(--ftg-ink); line-height: 1.4; }
.ai-gen-vraag-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ftg-indigo-soft); color: var(--ftg-indigo); border: 1px solid rgba(50,20,203,.18);
  border-radius: 999px; padding: 3px 12px 3px 3px; font-size: 13px; font-weight: 700;
}
.ai-gen-vraag-num {
  display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px;
  border-radius: 999px; background: var(--ftg-indigo); color: #fff; font-size: 11px; font-weight: 800; flex: 0 0 auto;
}
.ai-gen-vraag-chip-naam { line-height: 1; }
.ai-gen-vraag-chip-groen { background: var(--ftg-green-soft); color: var(--ftg-green-ink); border-color: var(--ftg-green-line); }
.ai-gen-vraag-chip-groen .ai-gen-vraag-num { background: var(--ftg-green-deep); }

/* Genummerde badge op het blokje in de live preview (zelfde nummer als de vraag) */
.ai-gen-badge {
  display: flex; align-items: center; justify-content: center; width: 22px; height: 22px;
  border-radius: 999px; color: #fff; font-size: 12px; font-weight: 800;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25); border: 2px solid #fff;
}
.ai-gen-badge-open { background: var(--ftg-indigo); }
.ai-gen-badge-groen { background: var(--ftg-green-deep); }

/* Animerende cirkel die om een blokje pulseert als je op de vraag klikt (zoals het interview) */
.ai-gen-puls {
  width: 64px; height: 64px; border-radius: 50%; border: 3px solid var(--ftg-indigo);
  transform: translate(-50%, -50%); pointer-events: none; box-shadow: 0 0 0 2px rgba(50,20,203,0.25);
  animation: ai-gen-puls 1.4s ease-out 2;
}
@keyframes ai-gen-puls {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0.95; }
  100% { transform: translate(-50%, -50%) scale(1.8); opacity: 0; }
}
/* Vraag die even oplicht als je op het bijbehorende blokje klikt */
.ai-gen-vraag.is-gemarkeerd { box-shadow: 0 0 0 3px var(--ftg-indigo); transition: box-shadow .15s ease; }
.ai-gen-vraag-input {
  width: 100%; box-sizing: border-box; resize: vertical; font: inherit; font-size: 14px;
  padding: 9px 11px; border: 1.5px solid var(--ftg-line); border-radius: 9px; background: #fff;
}
.ai-gen-vraag-input:focus { outline: none; border-color: var(--ftg-indigo); box-shadow: 0 0 0 3px rgba(50,20,203,0.12); }
.ai-gen-vraag.is-beantwoord .ai-gen-vraag-input { border-color: var(--ftg-green-line); }
.ai-gen-vragen-acties { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ai-gen-vragen-acties .ai-gen-generate-btn { flex: 0 0 auto; max-width: none; }
.ai-gen-vragen-hint { font-size: 12px; color: var(--ftg-muted); }
/* Los interim-regeltje vervalt: ingesproken tekst gaat nu direct in het tekstvak (afspraak Remco 27-6). */
.ai-gen-panel .ai-gen-interim { display: none; }

/* --- SUGGESTIES (klikbare voorbeelden) --- */
.ai-gen-suggestions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  animation: ai-gen-slide-up 0.55s ease-out;
}
.ai-gen-suggestions.hidden { display: none; }
.ai-gen-suggestions-label {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  margin-right: 4px;
}
.ai-gen-suggestion-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  background: white;
  color: #334155;
  border: 1.5px solid #e2e8f0;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 1px 3px rgba(15,23,42,0.04);
}
.ai-gen-suggestion-chip:hover {
  border-color: var(--ftg-indigo);
  color: var(--ftg-indigo);
  background: var(--ftg-indigo-soft);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(50,20,203,0.12);
}

/* --- TIPS --- */
.ai-gen-tips {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  background: var(--ftg-indigo-soft);
  border-left: 3px solid var(--ftg-indigo);
  border-radius: 8px;
  font-size: 12.5px;
  color: #312A7A;
  line-height: 1.6;
}
.ai-gen-tips strong {
  font-weight: 700;
  color: var(--ftg-indigo);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* --- FOOTER (generate + status) --- */
.ai-gen-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px clamp(24px, 6vw, 80px) 22px;
  background: white;
  border-top: 1px solid #e2e8f0;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}
.ai-gen-panel .ai-gen-generate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  background: var(--ftg-green);
  color: var(--ftg-green-ink);
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(2,252,117,0.30);
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  flex: 1;
  max-width: 360px;
}
.ai-gen-panel .ai-gen-generate-btn svg { color: var(--ftg-green-ink); }
.ai-gen-panel .ai-gen-generate-btn:hover {
  background: var(--ftg-green-deep);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(2,252,117,0.40);
}
.ai-gen-panel .ai-gen-generate-btn:active { transform: translateY(0); }
.ai-gen-panel .ai-gen-generate-btn:disabled {
  background: #D7DEEA;
  color: #94A3B8;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
.ai-gen-panel .ai-gen-clear-btn {
  padding: 12px 22px;
  background: white;
  color: #475569;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.ai-gen-panel .ai-gen-clear-btn:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #334155;
}
.ai-gen-panel .ai-gen-status {
  font-size: 13px;
  color: #475569;
  margin-left: auto;
}
.ai-gen-panel .ai-gen-actions { display: none; } /* legacy wrapper, no longer used */

@media (max-width: 720px) {
  .ai-gen-topbar { padding: 11px 16px; gap: 10px; }
  .ai-gen-topbar-div { display: none; }
  .ai-gen-topbar-head .ai-gen-subtitle { display: none; }
  .ai-gen-body { padding: 18px 20px 8px; gap: 12px; }
  .ai-gen-footer { padding: 14px 20px 18px; flex-wrap: wrap; }
  .ai-gen-controls-hint { display: none; }
  .ai-gen-listen-text { display: none; }
  .ai-gen-suggestion-chip { font-size: 12px; padding: 8px 12px; }
}

/* ============ AI-CLARIFY (begripscheck vóór generate) ============ */
.ai-clarify-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 1800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: ai-gen-fade-in 0.18s ease-out;
}
.ai-clarify-card {
  background: white;
  border-radius: 16px;
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.3);
  padding: 24px 26px 22px;
  animation: ai-gen-slide-up 0.22s ease-out;
}
.ai-clarify-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.ai-clarify-sparkle { font-size: 22px; }
.ai-clarify-head h3 { font-size: 17px; font-weight: 700; color: #1a1a2e; margin: 0; }
.ai-clarify-sub {
  font-size: 13px;
  color: #475569;
  margin: 4px 0 18px;
  line-height: 1.55;
}
.ai-clarify-questions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}
.ai-clarify-q { display: flex; flex-direction: column; gap: 5px; }
.ai-clarify-q-text {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a2e;
}
.ai-clarify-q-input {
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ai-clarify-q-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.ai-clarify-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.ai-clarify-btn {
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid #e2e8f0;
  background: white;
  color: #475569;
  font-family: inherit;
}
.ai-clarify-btn-skip:hover { background: #f8fafc; border-color: #cbd5e1; }
.ai-clarify-btn-go {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  border-color: transparent;
}
.ai-clarify-btn-go:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(99, 102, 241, 0.32); }

.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,
#properties-content select:not(.rich-select) {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.15s;
}

/* De Engage-staptype-keuzelijst krijgt exact de invoerveld-stijl (zie regel
   hierboven). Alleen extra: witte achtergrond (een kale <select> erft anders
   de grijzige OS-styling) + pointer-cursor. Hoogte komt vanzelf goed via de
   gedeelde padding/font/border. */
#properties-content select:not(.rich-select) {
  background-color: #fff;
  cursor: pointer;
}

#properties-content input:focus,
#properties-content textarea:focus,
#properties-content select:not(.rich-select):focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* Engage-staptype: keuzelijst + AI-voorstel-knop op één rij, hint eronder. */
#properties-content .steptype-suggest-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
#properties-content .steptype-suggest-row select:not(.rich-select) {
  flex: 1;
  min-width: 0;
}
.steptype-suggest-btn {
  flex: 0 0 auto;
  padding: 0 10px;
  font-size: 12px;
  white-space: nowrap;
  border: 1px solid #c7d2fe;
  border-radius: 6px;
  background: #eef2ff;
  color: #4338ca;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.steptype-suggest-btn:hover:not(:disabled) {
  background: #e0e7ff;
  border-color: #a5b4fc;
}
.steptype-suggest-btn:disabled {
  opacity: 0.6;
  cursor: default;
}
.steptype-suggest-hint {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.4;
  color: #4338ca;
  background: #eef2ff;
  border: 1px solid #e0e7ff;
  border-radius: 6px;
  padding: 6px 8px;
}

#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); }
}

/* Zoekvak werkprocessen in het procesmodel (treffers-lijst + spring) */
.pm-search { position: relative; display: inline-block; margin-left: 12px; vertical-align: middle; }
.pm-search-input {
  padding: 7px 12px; border: 1px solid var(--border, #e5e7f0); border-radius: 8px;
  font: inherit; font-size: 13px; min-width: 220px; box-sizing: border-box;
}
.pm-search-results {
  position: absolute; top: 100%; left: 0; margin-top: 4px;
  width: max-content; min-width: 100%; max-width: min(680px, 92vw);
  background: #fff; border: 1px solid var(--border, #e5e7f0); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12); z-index: 50; max-height: 340px;
  overflow-y: auto; overflow-x: hidden; display: none;
}
.pm-search-item {
  display: block; width: 100%; text-align: left; padding: 8px 12px;
  border: none; background: none; font: inherit; font-size: 13px; cursor: pointer; color: #1a1a2e;
  white-space: normal;
}
.pm-search-item:hover { background: #f1f5f9; }
.pm-search-bp { color: #94a3b8; font-size: 12px; }
.pm-search-empty { padding: 8px 12px; color: #94a3b8; font-size: 13px; }

/* Klikbaar koppel-label (springt naar het werkproces) */
.pm-koppel-link:hover { text-decoration: underline; }
