/* Navstar Flows — werkvlak (v0.2): editor met modules als cirkels op een canvas. */
body.werkvlak { height: 100vh; overflow: hidden; }
main.werkvlak-main { max-width: none; padding: 0; display: flex; flex-direction: column; min-height: 0; position: relative; }
body.werkvlak > main > .melding:not(.wv-fouten) { position: fixed; top: 108px; left: 50%; transform: translateX(-50%); z-index: 70;
  box-shadow: var(--schaduw-zwaar); animation: weg 4s forwards; }
@keyframes weg { 0%, 80% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
.wv-fouten { position: fixed; top: 160px; left: 24px; z-index: 65; max-width: 520px; box-shadow: var(--schaduw-zwaar); }

.wv-kop { display: flex; align-items: center; gap: .8rem; height: 58px; padding: 0 1.25rem; background: var(--wit); border-bottom: 1px solid var(--rand-zacht); flex: none; z-index: 5; }
.wv-terug { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--inkt-zacht); }
.wv-terug:hover { background: var(--kopgrijs); color: var(--blauw-donker); }
input.wv-naam { border: 1px solid transparent; font-family: var(--kop); font-weight: 700; font-size: 1.3rem; color: var(--navy);
                width: min(560px, 50vw); height: 40px; padding: 0 .5rem; background: transparent; }
input.wv-naam:hover { border-color: var(--rand); }
input.wv-naam:focus { border-color: var(--blauw); background: var(--wit); }
.wv-gewijzigd { color: var(--let-op); font-weight: 600; font-size: .88rem; }

.canvas { flex: 1; position: relative; overflow: hidden; cursor: grab; touch-action: none; min-height: 0;
          background-color: #f6f9fc; background-image: radial-gradient(#c9d6e2 1.2px, transparent 1.2px); background-size: 22px 22px; }
.canvas.pakt { cursor: grabbing; }
.wereld { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.lijnen { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; }
.lijnen .lijn { stroke: #9fb4c6; stroke-width: 3; stroke-dasharray: 1 9; stroke-linecap: round; fill: none; }
.lijnen .lijn.leeg { stroke: #c9d6e2; }

.module { position: absolute; width: 140px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.module-cirkel { width: 92px; height: 92px; border-radius: 50%; border: 0; color: var(--wit); cursor: pointer; display: flex; align-items: center;
                 justify-content: center; box-shadow: 0 8px 22px rgba(11, 39, 64, .18), inset 0 -4px 0 rgba(0, 0, 0, .08); transition: transform .12s, box-shadow .12s; }
.module-cirkel svg { width: 40px; height: 40px; stroke-width: 1.8; }
.module-cirkel:hover { transform: scale(1.05); box-shadow: 0 12px 28px rgba(11, 39, 64, .24); }
.module.gekozen .module-cirkel { box-shadow: 0 0 0 5px var(--wit), 0 0 0 8px var(--blauw), 0 12px 28px rgba(11, 39, 64, .24); }
.module.fout .module-cirkel { box-shadow: 0 0 0 5px var(--wit), 0 0 0 8px var(--fout); }
.module-naam { margin-top: .7rem; font-weight: 600; font-size: .92rem; color: var(--navy); line-height: 1.25; }
.module-soort { font-size: .8rem; color: var(--inkt-mist); margin-top: .1rem; }
.module-klok { position: absolute; left: 14px; top: 58px; width: 34px; height: 34px; border-radius: 50%; background: var(--wit); color: var(--goed);
               display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 10px rgba(11, 39, 64, .18); }
.module-klok svg { width: 20px; height: 20px; }
.bel { position: absolute; top: -6px; left: 92px; min-width: 30px; height: 30px; padding: 0 .45rem; border-radius: 999px; border: 2px solid var(--wit);
       background: var(--navy); color: var(--wit); font: inherit; font-weight: 700; font-size: .85rem; cursor: pointer; box-shadow: 0 3px 10px rgba(11, 39, 64, .25); }
.bel.fout { background: var(--fout); }

.plus-knop { position: absolute; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.plus-knop.eind { width: 92px; height: 92px; border: 2px dashed #b4c6d6; background: rgba(255, 255, 255, .7); color: #8aa3b8; }
.plus-knop.eind svg { width: 34px; height: 34px; }
.plus-knop.eind:hover { border-color: var(--blauw); color: var(--blauw); background: var(--wit); }
.plus-knop.tussen { width: 26px; height: 26px; border: 1px solid var(--rand); background: var(--wit); color: var(--blauw); opacity: 0; transition: opacity .12s; }
.plus-knop.tussen svg { width: 14px; height: 14px; }
.canvas:hover .plus-knop.tussen { opacity: .9; }
.plus-knop.tussen:hover { opacity: 1; background: var(--blauw); color: var(--wit); border-color: var(--blauw); }

.zoom { position: absolute; right: 18px; bottom: 18px; display: flex; flex-direction: column; background: var(--wit); border-radius: 12px; box-shadow: var(--schaduw-zwaar); overflow: hidden; }
.zoom button { width: 40px; height: 38px; border: 0; background: none; color: var(--inkt-zacht); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.zoom button + button { border-top: 1px solid var(--rand-zacht); }
.zoom button:hover { color: var(--blauw); background: var(--blauw-zacht); }

.onderbalk { flex: none; height: 78px; background: var(--wit); border-top: 1px solid var(--rand-zacht); display: flex; align-items: center; gap: 1rem;
             padding: 0 1.25rem; box-shadow: 0 -6px 20px rgba(0, 60, 100, .05); z-index: 5; }
.speel { width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--verloop); color: var(--wit); cursor: pointer; display: flex;
         align-items: center; justify-content: center; box-shadow: 0 6px 18px rgba(0, 136, 202, .35); flex: none; }
.speel svg { width: 26px; height: 26px; fill: currentColor; stroke: none; margin-left: 3px; }
.speel:hover { filter: brightness(1.08); }
.ob-tekst { display: flex; flex-direction: column; line-height: 1.2; }
.ob-tekst strong { font-family: var(--kop); color: var(--navy); }
.ob-tekst span { font-size: .8rem; color: var(--inkt-mist); }
.ob-scheiding { width: 1px; height: 38px; background: var(--rand-zacht); }
.ob-stand { display: flex; align-items: center; gap: .5rem; }
.ob-start { color: var(--inkt-zacht); font-size: .9rem; font-weight: 600; }
.ob-rechts { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.ob-knop { display: inline-flex; align-items: center; gap: .45rem; height: 40px; padding: 0 .9rem; border-radius: 999px; border: 0; background: none;
           font: inherit; font-weight: 600; color: var(--inkt-zacht); cursor: pointer; }
.ob-knop:hover { background: var(--kopgrijs); color: var(--blauw-donker); }

.lade { position: fixed; right: 0; top: 150px; bottom: 78px; width: 430px; max-width: 100vw; background: var(--wit); border-left: 1px solid var(--rand-zacht);
        box-shadow: -14px 0 40px rgba(0, 60, 100, .1); z-index: 40; display: flex; flex-direction: column; }
.lade-kop { display: flex; align-items: center; gap: .8rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--rand-zacht); }
.lade-kop h2 { font-size: 1.15rem; flex: 1; }
.lade-titel { flex: 1; min-width: 0; }
.lade-titel h2 { font-size: 1.1rem; }
.lade-titel span { font-size: .82rem; }
.lade-rond { width: 44px; height: 44px; border-radius: 50%; color: var(--wit); display: flex; align-items: center; justify-content: center; flex: none; }
.lade-rond svg { width: 22px; height: 22px; }
.lade-inhoud { flex: 1; overflow-y: auto; padding: 1.1rem 1.2rem; }
.lade-uitleg { color: var(--inkt-zacht); font-size: .9rem; margin-bottom: 1rem; }
.lade-sub { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--inkt-mist); margin: 1.2rem 0 .5rem; }
.lade-voet { display: flex; gap: .4rem; align-items: center; padding: .8rem 1.2rem; border-top: 1px solid var(--rand-zacht); }
.lade-voet .rechts { margin-left: auto; min-width: 72px; }
.lade .paar { grid-template-columns: 120px 1fr 32px; }
.uitvoer .meldingen { list-style: none; padding: 0; margin: .5rem 0; }
.uitvoer .meldingen li { padding: .15rem 0; color: var(--inkt-zacht); font-size: .9rem; }
.uitvoer details { margin: .5rem 0; }
.uitvoer .foutregel { color: #a8262b; font-weight: 600; }
table.lijst.klein td { padding: .35rem .5rem; font-size: .85rem; word-break: break-word; }
.lade-inhoud > .knop { margin-top: 1rem; }

.kiezer-pop { position: fixed; z-index: 80; width: 380px; max-height: min(520px, calc(100vh - 270px)); overflow-y: auto; background: var(--wit); border: 1px solid var(--rand);
              border-radius: var(--r); box-shadow: var(--schaduw-zwaar); padding: .8rem; }
.kiezer-pop h3 { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--inkt-mist); margin: .7rem .3rem .3rem; }
.kiezer-pop button { display: flex; gap: .7rem; align-items: center; width: 100%; text-align: left; border: 0; background: none; border-radius: 10px;
                     padding: .5rem; font: inherit; cursor: pointer; color: var(--inkt); }
.kiezer-pop button:hover { background: var(--blauw-zacht); }
.kiezer-pop strong { display: block; font-size: .93rem; }
.kiezer-pop small { display: block; color: var(--inkt-mist); font-size: .8rem; line-height: 1.3; }
.kiezer-rond { width: 38px; height: 38px; border-radius: 50%; color: var(--wit); display: flex; align-items: center; justify-content: center; flex: none; }
.kiezer-rond svg { width: 19px; height: 19px; }

/* ---- v0.3: router, takken, voorwaarden, code */
.module-cirkel.router { width: 76px; height: 76px; margin: 8px 0; }
.module-cirkel.router svg { width: 34px; height: 34px; }
.lijnen .lijn.tak { stroke: #9fb4c6; }
.taklabel { position: absolute; height: 30px; display: inline-flex; align-items: center; gap: .35rem; padding: 0 .7rem; border-radius: 999px;
            border: 1px solid var(--rand); background: var(--wit); color: var(--inkt-zacht); font: inherit; font-size: .8rem; font-weight: 600;
            cursor: pointer; box-shadow: 0 3px 10px rgba(11, 39, 64, .08); white-space: nowrap; max-width: 150px; }
.taklabel span { overflow: hidden; text-overflow: ellipsis; }
.taklabel svg { width: 13px; height: 13px; color: var(--let-op); }
.taklabel.anders svg { color: var(--inkt-mist); }
.taklabel:hover, .taklabel.gekozen { border-color: var(--blauw); color: var(--blauw-donker); }
.plus-knop.klein-eind { width: 64px; height: 64px; }
.plus-knop.klein-eind svg { width: 26px; height: 26px; }
.module-fout { position: absolute; top: -6px; left: 18px; width: 24px; height: 24px; border-radius: 50%; background: var(--let-op); color: var(--wit);
               font-weight: 700; font-size: .8rem; display: flex; align-items: center; justify-content: center; border: 2px solid var(--wit); }
.voorwaarden .voorwaarde { display: grid; grid-template-columns: 1fr 150px 1fr 32px; gap: .4rem; margin-bottom: .45rem; align-items: center; }
.voorwaarden select, .voorwaarden input { height: 36px; font-size: .88rem; }
textarea.codeveld { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .82rem; line-height: 1.45; background: #0f1b2a; color: #dbe7f3; border-color: #0f1b2a; tab-size: 2; }
.veldlink { display: inline-block; margin-top: .3rem; font-size: .82rem; font-weight: 600; }
.veldnoot { display: block; margin-top: .3rem; color: var(--inkt-mist); font-size: .8rem; }
.takknop { display: flex; justify-content: space-between; align-items: center; width: 100%; border: 1px solid var(--rand-zacht); background: var(--wit);
           border-radius: 10px; padding: .55rem .7rem; margin-bottom: .4rem; cursor: pointer; font: inherit; }
.takknop:hover { border-color: var(--blauw); }
.kiezer-pop h4 { font-size: .8rem; color: var(--navy); margin: .5rem .5rem .1rem; font-family: var(--kop); }
.lade .veld.heel { display: block; }

/* ---- v0.5: koppelen, losse modules, menu, mapping, filters op lijnen */
.lijnen { pointer-events: none; }
.lijnen .lijn-raak { pointer-events: stroke; stroke: transparent; stroke-width: 18; fill: none; cursor: pointer; }
.lijnen .lijn-raak:hover { stroke: rgba(0, 136, 202, .12); }
.lijnen .lijn.met-filter { stroke: #e8a14c; }
.lijnen .lijn.koppelend { stroke: var(--blauw); stroke-dasharray: 6 6; stroke-width: 3; }
.module .handvat { position: absolute; left: 112px; top: 34px; width: 22px; height: 22px; border-radius: 50%; background: var(--wit);
                   border: 2px solid var(--blauw); cursor: crosshair; opacity: 0; transition: opacity .12s; box-shadow: 0 2px 8px rgba(0, 60, 100, .2); }
.module:hover .handvat { opacity: 1; }
.module .handvat::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--blauw); }
.module.doel .module-cirkel { box-shadow: 0 0 0 5px var(--wit), 0 0 0 8px var(--goed); }
.module.los .module-cirkel { box-shadow: 0 0 0 4px var(--wit), 0 0 0 6px #c9d6e2; }
.module.los::before { content: "Niet gekoppeld"; position: absolute; top: -26px; font-size: .72rem; color: var(--inkt-mist); font-weight: 600; }
.module.uitgeschakeld .module-cirkel { opacity: .38; filter: grayscale(.6); }
.module.uitgeschakeld .module-naam { color: var(--inkt-mist); text-decoration: line-through; }
.canvas.sleept { cursor: grabbing; }
.module-notitie { position: absolute; top: 60px; left: 22px; width: 26px; height: 26px; border-radius: 50%; background: #fff3c4; border: 2px solid var(--wit);
                  color: #8a6d00; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.module-notitie::after, .module-waarschuwing::after { content: none; }
.module-notitie svg { width: 14px; height: 14px; }
.module-waarschuwing { position: absolute; top: -8px; left: 20px; width: 28px; height: 28px; border-radius: 50%; background: var(--let-op); color: var(--wit);
                       border: 2px solid var(--wit); display: flex; align-items: center; justify-content: center; }
.module-waarschuwing svg { width: 15px; height: 15px; }
.module-fout { cursor: default; }
.linkfilter { position: absolute; height: 28px; display: inline-flex; align-items: center; gap: .3rem; padding: 0 .65rem; border-radius: 999px; max-width: 140px;
              border: 1px solid #f0c48f; background: #fff7ec; color: #8a4b00; font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.linkfilter span { overflow: hidden; text-overflow: ellipsis; }
.linkfilter svg { width: 12px; height: 12px; }
.wv-status { font-size: .84rem; color: var(--inkt-mist); }
.wv-status.concept { color: #a35400; }
.wv-status.fout { color: var(--fout); font-weight: 600; }
.wv-fouten-knop { border: 1px solid #f6c9cb; background: #fdecec; color: #a8262b; border-radius: 999px; height: 30px; padding: 0 .8rem; font: inherit;
                  font-size: .82rem; font-weight: 600; cursor: pointer; }
.wv-conceptweg { margin-left: auto; }
.icoon-knop { padding: 0 .6rem; }
.speel.bezig { animation: puls 1s infinite; pointer-events: none; }
@keyframes puls { 50% { opacity: .55; } }
.menu { position: fixed; z-index: 150; min-width: 260px; background: var(--wit); border: 1px solid var(--rand); border-radius: 14px; box-shadow: var(--schaduw-zwaar);
        padding: .35rem; }
.menu-item { display: flex; align-items: center; gap: .6rem; width: 100%; border: 0; background: none; border-radius: 9px; padding: .42rem .6rem; font: inherit;
             font-size: .9rem; color: var(--inkt); cursor: pointer; text-align: left; }
.menu-item svg { width: 16px; height: 16px; color: var(--inkt-zacht); }
.menu-item span { flex: 1; }
.menu-item kbd { font-family: var(--tekst); font-size: .75rem; color: var(--inkt-mist); }
.menu-item:hover:not(:disabled) { background: var(--blauw-zacht); color: var(--blauw-donker); }
.menu-item:disabled { color: var(--inkt-mist); cursor: default; }
.menu-item.gevaar, .menu-item.gevaar svg { color: #a8262b; }
.menu-item.aan svg { color: var(--goed); }
.menu-streep { height: 1px; background: var(--rand-zacht); margin: .3rem .2rem; }
.menu-kop { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--inkt-mist); padding: .4rem .6rem .15rem; font-weight: 600; }
.mapping { position: fixed; right: 438px; top: 162px; bottom: 90px; width: 320px; z-index: 41; background: var(--wit); border: 1px solid var(--rand);
           border-radius: 14px; box-shadow: var(--schaduw-zwaar); display: flex; flex-direction: column; overflow: hidden; }
.mapping-kop { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .6rem .7rem; border-bottom: 1px solid var(--rand-zacht); }
.mapping-inhoud { flex: 1; overflow-y: auto; padding: .4rem .5rem .8rem; }
.map-groep h4 { font-family: var(--kop); font-size: .86rem; color: var(--navy); margin: .7rem .3rem .25rem; }
.map-item { display: flex; justify-content: space-between; gap: .6rem; width: 100%; border: 0; background: none; border-radius: 8px; padding: .3rem .45rem;
            font: inherit; cursor: pointer; text-align: left; }
.map-item:hover { background: var(--blauw-zacht); }
.map-item code { color: var(--blauw-donker); font-size: .8rem; white-space: nowrap; }
.map-item small { color: var(--inkt-mist); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }
.map-hint { background: #fff8ec; border: 1px solid #f3d6a6; border-radius: 10px; padding: .55rem .7rem; font-size: .82rem; color: #7a4300; margin: .3rem; }
.lade-notitie { background: #fff8d6; border: 1px solid #f1e2a0; border-radius: 10px; padding: .6rem .75rem; font-size: .88rem; color: #6b5400; margin: .8rem 0; white-space: pre-wrap; }
.lade .melding ul { margin: .3rem 0 0 1.1rem; font-weight: 500; }

/* ---- v0.6: instellingen als venster bij de module (zoals Make) */
.lade.popup { right: auto; bottom: auto; width: 460px; max-width: calc(100vw - 24px); max-height: calc(100vh - 262px); border: 1px solid var(--rand);
              border-radius: 18px; box-shadow: 0 22px 60px rgba(0, 40, 70, .22); border-left: 1px solid var(--rand); z-index: 45; }
.lade.popup .lade-kop { border-radius: 18px 18px 0 0; }
.lade.popup .lade-voet { border-radius: 0 0 18px 18px; background: var(--wit); }
.lade.popup::before { content: ""; position: absolute; top: var(--pijl-y, 40px); width: 16px; height: 16px; background: var(--wit); transform: rotate(45deg); }
.lade.popup.pijl-links::before { left: -9px; border-left: 1px solid var(--rand); border-bottom: 1px solid var(--rand); }
.lade.popup.pijl-rechts::before { right: -9px; border-right: 1px solid var(--rand); border-top: 1px solid var(--rand); }
.lade.popup .lade-titel h2 { font-size: 1.12rem; }
.mapping { right: auto; bottom: auto; }

/* ---- verbindingen trekken */
.canvas { user-select: none; -webkit-user-select: none; }
.module .handvat { left: 104px; top: 32px; width: 28px; height: 28px; border: 2px solid var(--blauw);
                   background: radial-gradient(circle, var(--blauw) 0 5px, var(--wit) 6px); }
.module .handvat::after { content: none; }
.module .handvat::before { content: ""; position: absolute; inset: -12px; border-radius: 50%; }
.module .handvat:hover { transform: scale(1.12); }
.canvas.koppelt .module .handvat { opacity: 0; }
.canvas.koppelt { cursor: crosshair; }
.lijnen .lijn.koppelend.raak { stroke: var(--goed); stroke-dasharray: none; }
.module.doel .module-cirkel { transform: scale(1.08); transition: transform .1s; }

input.wv-naam { width: auto; min-width: 16ch; max-width: 60ch; }
